Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a potential error with undefined value in Transport/SNMP.pm #1121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

earendilfr
Copy link
Contributor

@earendilfr earendilfr commented Nov 10, 2023

Sometimes, I can see in the job queue that some jobs are in a wrong format because we try to call a new method to an undefined object
image

I suspect that for an unknown reason, sometimes, the $class variable is undefined...

So, I have added a test to validate that the object is defined prior to call the new method

@earendilfr earendilfr force-pushed the fixe_error_undefined_snmp_trasnport branch from eb9d286 to 37771d2 Compare November 10, 2023 14:28
@earendilfr earendilfr marked this pull request as ready for review November 10, 2023 14:30
@ollyg
Copy link
Member

ollyg commented Nov 12, 2023

thanks @earendilfr !
the reason I didn't yet merge this is I'd like to understand why it's happening, as it should not, and maybe the fix is to refactor instead of workaround. thanks for raising the issue, I will take a look.
if you can somehow work out any pattern or reproducing device, do let us know!

@earendilfr
Copy link
Contributor Author

Hi @ollyg, I will try to reproduce the reason of this error.
One difficulty is the error are not showed in netdisco-backend logs, only in jobqueue through WebUI...

@inphobia
Copy link
Member

lemme know what you need, always have some of these in my logs

image

see this with discover jobs most of the time, in rare cases with arpnip. macsuck i can't see in my current list.

also get this at times, just no message:

image

one very important note, i'm using:

# discover everything without serials
snmp_field_protection:
  device:
    serial: ['!group:__ANY__']

the ip range tells me this is a 4g device using nbm (network behind mobile. using private apn & provider pushes the routes when it comes online). we have around 2000 such devices & our field team swaps them, often with a different vendor depending on what we have in stock.

@earendilfr
Copy link
Contributor Author

earendilfr commented May 13, 2024

I confirm I have also tasks in error without any reason when I check:
image

But I didn't have the config part indicated by @inphobia.

Perhaps an help concerning this incident could be to add, in job queue log, the date and hours where the job was started and finished...

EDIT: forget, I didn't have seen that these informations are available with the "+" icon 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

3 participants