kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.94k stars 492 forks source link

Fix for "AttributeError: 'NoneType' object has no attribute 'split'" #1266

Open kizniche opened 1 year ago

kizniche commented 1 year ago

When visiting the upgrade page or viewing the daemon log, you may see this error (end of the traceback):

File "/home/mycopitt/Mycodo/mycodo/mycodo_flask/routes_admin.py", line 534, in admin_upgrade
current_latest_major_version = current_latest_release.split('.')[0]
AttributeError: 'NoneType' object has no attribute 'split'

You can fix this issue with the following command:

sudo sed -i 's/v\.\*(\\d\\\.\\d\\\.\\d)/v(\\d+)\\\.(\\d+)\\\.\\d+/g' ~/Mycodo/mycodo/utils/github_release_info.py && sudo service mycodoflask restart

kizniche commented 1 year ago

This issue has been mentioned on Radical DIY Forum. There might be relevant details there:

https://forum.radicaldiy.com/t/cant-upgrade-attributeerror-nonetype-object-has-no-attribute-split/1385/2