-
Notifications
You must be signed in to change notification settings - Fork 44
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
Receiving 'NoneType' error when using meraki_management_interface on some MR devices #250
Comments
Thank you for the report. I'll try to take a look at it this weekend. Do you have any custom settings that may cause this? Have you tried this same function using a Python script natively? I'm trying to determine if it's a bug with my code (probably) or if it's in the API (much less likely) that's triggering a bug. |
I don't think I have anything custom that would cause this, my environment is pretty simple, but who knows. I haven't tried the same function using Python natively, I was happy to just get this working. The issue didn't occur very often, maybe only 5% of the time and sometimes repeating the play 3-4 times would finally get it to work, so it seems random to me. |
@sstone173 I tested this on my end and it seems to work fine. Admittedly, it's intermittent for you so I didn't expect it would reproduce easily here. A few thoughts:
Either way, I should be handling this exception. That fixes the symptom but not the bug though. |
I can perform some additional testing if you send me the updated file, shouldn't be an issue. The issue didn't seem to be specific to model or any particular AP configuration, that's what made it a bit confusing to troubleshoot on my end as well. |
I'll need a few days to develop and test the code. My current thought is if it catches an exception in that area, it will output the payload from the request so we can see what is being submitted. I'll also have it output the HTTP code to see if we're getting back a bad code. It's probably not a bad thing to have the capability for anyways. |
I haven't tested this since I can't reproduce the bug. But please find the location where the Meraki collection is installed. Go into Update: I had an error in the syntax and fixed it. Please redownload if you have it already. |
Updated the meraki.py file, but haven't been able to reproduce the issue so far, so I'm thinking it may have just been a temporary issue on my end, possibly network related. |
You bring up a good point. Before the custom code, it would fail as an unhandled exception. Now, catching the exception so it should still continue to execute. I'll modify the code to catch the exception and fail with better output. I'm on PTO the next couple of days so I should be able to make the changes by the weekend. |
@sstone173 Sorry about the delay. I updated the gist so it should fail if |
@kbreit Updated the gist and ran the playbook against a bunch of our sites and was not able to replicate the issue. I'll be updating a large number of sites again in a month or so, so feel free to close this issue and I can reopen or create a new one if I run into it again during that project. |
Go ahead and keep this open for a while. No need to close it. I'll check back in later this year. |
@sstone173 Funny story. I sit down tonight to start some development on a new module. I'm putting together the framework for the integration tests and run one. I'll give you one guess on what error I received. I ran it again, worked fine. |
Yes, that does sound familiar :) |
still happens in other modules too, from time to time. usually, running again makes the error go away
|
That's what I've seen. My theory is it's a server side error but can't reproduce it enough to be helpful. If you'd like, I can see if I can get the Meraki team in contact with you to troubleshoot. |
I'm communicating with them about some other issues, and this happens... sporadically. |
Makes sense. I'm going to at a minimum catch the exception and handle it so it doesn't crash. If I can get it to redo the request, I'll add that in too. |
@mtb-xt I'm doing a little troubleshooting and added debugging code. I've had this issue three times tonight and got this output.
A quick search with that error and urllib, which I think Ansible uses, returns https://stackoverflow.com/questions/11981933/python-urllib2-cannot-assign-requested-address. I'm looking into this further but made progress. To your point, yes, this should be caught somehow. But if I can solve the problem, that's even better! |
@mtb-xt When you receive these errors, are they local on your system or a dedicated server? I ask because I had a lot of errors while addressing #257 but after quitting Slack and Discord, the errors seem to have largely disappeared. Update: This may not be the problem. Having lots of problems still. |
@sstone173 I created a pull request to handle and retry the request 5 times before failing. I think this is due to something with Docker because as soon as I started running my tests locally and not in Docker, the errors disappeared. Because this problem is intermittent I can't test it. But please try this patch in a test environment and let me know if this fixes the issues. Thank you. |
While updating DNS settings on a large group of MR devices some fail with the error "AttributeError: 'NoneType' object has no attribute 'read'\n". Haven't been able to discover any correlation when updating like devices and configurations, some devices just error out while others succeed.
Play
Loop Tasks (loop_meraki_update_mr_ip_settings.yaml)
Output
The text was updated successfully, but these errors were encountered: