How to limit snapshots under developer

Hi,

Is there any way to stop or limit notifications from developer module such as, error snapshots which are actually normal things for me (password errors, lack of privilage etc).

2 Likes

@ferohers, I’m the creator of the Error Snapshot, what are your suggestion?

You can enumerate here, the type of errors that you can mute, or the situation, for we discuss?

Hi

@max_morais_dmm it is wonderful to have such feature first of all. I was wondering if there is a way to mute some of the notifications. if at this stage it is not possible then all is ok.

Here are some notification types kept appearing on my setup.

AuthenticationError() (We have a strict password policy and our users enter their passwords wrongly due to complex passwords. aD#$__@.

However, it must be very useful for other admins to check their security and possible breaches.

DoesNotExistError (leave and expense requests) all seems ok cannot figure out which leave and/or expense causing the issue.

CSRFTokenError (logged out users attempt to do things)

PermissionError() (this appear when people try to approve their own expense and leave but cannot figure out who)

@ferohers, I have some small changes to do, one of these changes is, disable globally the importing process of the error snapshot, and add in site_config, a option, to one instance collect all errors!

Will very nice, in my point of view, for the Administrator, manage it at a single instance, instead of the actual scheme.

Another issue, that I’m facing, is to check the type of the variable, some cases I dont know if the error is raised by a None value or for a empty string.

So, my proposal is:

Add 2 Options in System Settings, one is:

  • Disable Error Snapshot collector
  • On collect ignore these Exceptions: where you can enter a list of errors classes.

Add the behavior to check if the key “collect_error_for_sites” is active in site_config.json, so only a single instance will collect all error if the error collection is disabled in other instances.

And you can manage the System Settings, via “Fixtures”

What do you think?

@rmehta, it make sense to you as a System Manager?

1 Like

@max_morais_dmm
Frankly,

I agree with you. I have learned a lot from the snapshot collector. However, I have limited knowledge to develop so error reports not that useful for me. It would be fantastic to if it can be disabled / enabled.

@max_morais_dmm - I agree, lets not catch exception that happen regularly. Also lets stop catching Permission and NotFound errors.

Or maybe just remove it from the notifications!

1 Like

@rmehta I Agree, I’ll prepare a patch

1 Like

@ferohers, I have been noticed that you can disable globally the error snapshot via site_config

Only add a new key disable_error_snapshot as 1

@max_morais_dmm I have just added it to my site_config. Just wanted to give a hint that if it is added at the end it causes 500 internal server error.

I added it just after db_name

{
“host_name”: “my.my.mysite”,
“db_password”: “kfmsklmflksmfdls03jsa”,
“db_name”: “erpnext”,
“disable_error_snapshot”: 1,
“dropbox_access_key”: “fsfdfds3333a”,
“dropbox_secret_key”: “bfdqd4r55555”
}

@ferohers, maybe because on add to end, do you forget of add a ", " in the last line, or remove ", " from the end of the line.

Wrong:

{
"host_name": "my.my.mysite", 
"db_password": "kfmsklmflksmfdls03jsa", 
"db_name": "erpnext", 
"dropbox_access_key": "fsfdfds3333a", 
"dropbox_secret_key": "bfdqd4r55555"
"disable_error_snapshot": 1,
}

Wrong too

{
"host_name": "my.my.mysite", 
"db_password": "kfmsklmflksmfdls03jsa", 
"db_name": "erpnext", 
"dropbox_access_key": "fsfdfds3333a", 
"dropbox_secret_key": "bfdqd4r55555",
"disable_error_snapshot": 1,
}

Right

{
"host_name": "my.my.mysite", 
"db_password": "kfmsklmflksmfdls03jsa", 
"db_name": "erpnext", 
"dropbox_access_key": "fsfdfds3333a", 
"dropbox_secret_key": "bfdqd4r55555",
"disable_error_snapshot": 1
}

@max_morais_dmm thank you very much!