kizniche / Mycodo

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

user password lost after upgrade to version: 8.13.1 and Error 502: Bad Gateway Error #1166

Closed tezztuzer closed 2 years ago

tezztuzer commented 2 years ago

Hi,

Thank you for mycodo! Great software! I have two raspberry pi's running at different locations and wanted to upgrade them to the latest version 8.13.1. The previously installed mycodo version was v8.12.9 The upgrade completed successfully but after the upgrade, for both pi's the previously setup username/password combination didn't worked any more. I managed to reset the password via the file. After loging in, both rasbperry pi's returned the following error:

Error 502: Bad Gateway Error
Something bad happened but it's probably not your fault. Try refreshing the page to see if it will load. If that doesn't work, try rebooting your system, then try refreshing it again. If that still doesn't work, submit a [new issue on GitHub](https://github.com/kizniche/Mycodo/issues/new?template=problem-bug-report.md) with any useful information that can help determine the cause of this issue.

The last 50 lines from the Mycodo frontend web log can be viewed with the command:

journalctl -u mycodoflask | tail -n 50
If you create an issue on GitHub, provide this excerpt of the log for diagnostic purposes.

One raspberry pi was rebooted and that solved the issue. Unfortunately for the second raspberry pi reboot (multiple times) didn't helped.

journalctl output:

journalctl -u mycodoflask | tail -n 50
-- Logs begin at Tue 2022-03-29 12:08:53 EEST, end at Tue 2022-03-29 12:12:51 EEST. --
Mar 29 12:09:01 salamior systemd[1]: Started Mycodo web user interface.
Mar 29 12:09:03 salamior python[382]: /var/mycodo-root/env/bin/python: No module named gunicorn
Mar 29 12:09:03 salamior systemd[1]: mycodoflask.service: Main process exited, code=exited, status=1/FAILURE
Mar 29 12:09:03 salamior systemd[1]: mycodoflask.service: Failed with result 'exit-code'.

I don't have physical, only remote access to the affected raspberry, Could this be fixed easily or better re-install mycodo?

Thank you.

kizniche commented 2 years ago

Rebooting is instructed in the changelog to complete the upgrade. You do not need to reset the password, just reboot.

As for your second upgrade that was not successful, did you review the upgrade log?

tezztuzer commented 2 years ago

Hi,

The upgrade.log file from the failed upgrade ends with " [2022-03-29 11:55:11] #### Executing post-alembic script" . It just looks normal but ends abruptly there. The upgrade.log file from the successful upgrade continues with "[2022-03-29 11:31:26] Found revision IDs to execute code: ['b354722c9b8b']" etc.

I've attached the mycodoupgrade.log file in case needed.

mycodoupgrade.log

Thanks.

kizniche commented 2 years ago

How long did you give it to complete the upgrade before rebooting? You may have interrupted the upgrade.

tezztuzer commented 2 years ago

Approximately 5 minutes I would say...Ok then I will re'install mycodo to get it back in working state. Thanks and have a great day!

kizniche commented 2 years ago

You most likely interrupted the upgrade. 5 minutes is not a lot of time. You don't need to reinstall. See if this command fixes whatever issue it has:

sudo ~/Mycodo/mycodo/scripts/upgrade_post.sh
tezztuzer commented 2 years ago

That solved the issue.
Thank you