mynodebtc/mynode

Fresh install of 0.3.17 (PC/amd64) image: no MyNode webpage served from localhost

lasermind opened this issue ยท 14 comments

Describe the bug
Flashed the latest PC image 0.3.17 to my system drive. Booted the system and Debian started. Logged in with "admin/bolt". Empty browser window opens with the message "This site can't be reached". No page was served.

Expected behavior
Browser window should have opened the webpage from localhost, showing the MyNode login form automatically.

Screenshots

mn-debian

mn-browser

Desktop:
Used the built-in Chromium browser of course, from 0.3.17.

MyNode hardware:

  • Device: Intel NUC (500GB SSD system drive, 2TB SSD data drive)
  • MyNode Version: 0.3.17, downloaded today and flashed freshly to the system drive

Additional context
Seems like maybe nginx is not started automatically at bootup to server the webpage. The rest of the system seems to run, as far as I can tell. Bitcoind, dockerd, containerd, tor, npm and everything is started and visible in glances. I can also login via SCP and "admin/bolt" to the machine. The machine also has internet access; I can surf to webpages normally. Only the expected MyNode page from localhost is not showing up.

What could be wrong here?

Can you try running this command and share the output?

sudo systemctl status www

Thanks for reply! Sure, here is the output:

โ— www.service - myNode Web Server
   Loaded: loaded (/etc/systemd/system/www.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2023-05-22 04:30:35 CDT; 7s ago
  Process: 28195 ExecStart=/usr/bin/mynode_www.sh (code=exited, status=1/FAILURE)
 Main PID: 28195 (code=exited, status=1/FAILURE)

Seems as if a service is not started.

The funny thing is: I executed sudo systemctl status www several times. When I time it correctly, for some milliseconds I get an "active" process. But then the process stops again after some more milliseconds. So it seems as if the webserver process can not be started correctly for some reason and is hung up is a re-activation loop.

It seems as if this problem is happening in all two of the new 0.3.17 images; see newest issue #789.

Could you try this? It should show the exact reason it's failing.

sudo journalctl -u www

Sure, here is the log:

May 23 10:35:42 myNode systemd[1]: Started myNode Web Server.
May 23 10:35:44 myNode www[28710]: RESTART COUNT: 1 (PYTHON3)
May 23 10:35:44 myNode www[28710]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:35:44 myNode www[28710]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:35:44 myNode www[28710]: Traceback (most recent call last):
May 23 10:35:44 myNode www[28710]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:35:44 myNode www[28710]:     @app.before_first_request
May 23 10:35:44 myNode www[28710]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:35:44 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:35:44 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:35:54 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:35:54 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14761.
May 23 10:35:54 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:35:54 myNode systemd[1]: Started myNode Web Server.
May 23 10:35:55 myNode www[28829]: RESTART COUNT: 2 (PYTHON3)
May 23 10:35:56 myNode www[28829]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:35:56 myNode www[28829]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:35:56 myNode www[28829]: Traceback (most recent call last):
May 23 10:35:56 myNode www[28829]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:35:56 myNode www[28829]:     @app.before_first_request
May 23 10:35:56 myNode www[28829]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:35:56 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:35:56 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:36:06 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:36:06 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14762.
May 23 10:36:06 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:36:06 myNode systemd[1]: Started myNode Web Server.
May 23 10:36:07 myNode www[28902]: RESTART COUNT: 3 (PYTHON3)
May 23 10:36:07 myNode www[28902]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:36:07 myNode www[28902]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:36:07 myNode www[28902]: Traceback (most recent call last):
May 23 10:36:07 myNode www[28902]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:36:07 myNode www[28902]:     @app.before_first_request
May 23 10:36:07 myNode www[28902]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:36:08 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:36:08 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:36:18 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:36:18 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14763.
May 23 10:36:18 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:36:18 myNode systemd[1]: Started myNode Web Server.
May 23 10:36:19 myNode www[28990]: RESTART COUNT: 4 (PYTHON2)
May 23 10:36:19 myNode www[28990]: Traceback (most recent call last):
May 23 10:36:19 myNode www[28990]:   File "/var/www/mynode/mynode.py", line 3, in <module>
May 23 10:36:19 myNode www[28990]:     from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:36:19 myNode www[28990]: ImportError: No module named flask
May 23 10:36:19 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:36:19 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:36:29 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:36:29 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14764.
May 23 10:36:29 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:36:29 myNode systemd[1]: Started myNode Web Server.
May 23 10:36:30 myNode www[29023]: RESTART COUNT: 0 (PYTHON3)
May 23 10:36:31 myNode www[29023]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:36:31 myNode www[29023]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:36:31 myNode www[29023]: Traceback (most recent call last):
May 23 10:36:31 myNode www[29023]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:36:31 myNode www[29023]:     @app.before_first_request
May 23 10:36:31 myNode www[29023]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:36:31 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:36:31 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:36:41 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:36:41 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14765.
May 23 10:36:41 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:36:41 myNode systemd[1]: Started myNode Web Server.
May 23 10:36:42 myNode www[29082]: RESTART COUNT: 1 (PYTHON3)
May 23 10:36:42 myNode www[29082]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:36:42 myNode www[29082]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:36:42 myNode www[29082]: Traceback (most recent call last):
May 23 10:36:42 myNode www[29082]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:36:42 myNode www[29082]:     @app.before_first_request
May 23 10:36:42 myNode www[29082]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:36:43 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:36:43 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:36:53 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:36:53 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14766.
May 23 10:36:53 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:36:53 myNode systemd[1]: Started myNode Web Server.
May 23 10:36:54 myNode www[29136]: RESTART COUNT: 2 (PYTHON3)
May 23 10:36:54 myNode www[29136]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:36:54 myNode www[29136]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:36:54 myNode www[29136]: Traceback (most recent call last):
May 23 10:36:54 myNode www[29136]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:36:54 myNode www[29136]:     @app.before_first_request
May 23 10:36:54 myNode www[29136]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:36:54 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:36:54 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:37:04 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:37:04 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14767.
May 23 10:37:04 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:37:04 myNode systemd[1]: Started myNode Web Server.
May 23 10:37:06 myNode www[29191]: RESTART COUNT: 3 (PYTHON3)
May 23 10:37:06 myNode www[29191]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:37:06 myNode www[29191]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:37:06 myNode www[29191]: Traceback (most recent call last):
May 23 10:37:06 myNode www[29191]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:37:06 myNode www[29191]:     @app.before_first_request
May 23 10:37:06 myNode www[29191]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:37:06 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:37:06 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:37:16 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:37:16 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14768.
May 23 10:37:16 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:37:16 myNode systemd[1]: Started myNode Web Server.
May 23 10:37:17 myNode www[29247]: RESTART COUNT: 4 (PYTHON2)
May 23 10:37:17 myNode www[29247]: Traceback (most recent call last):
May 23 10:37:17 myNode www[29247]:   File "/var/www/mynode/mynode.py", line 3, in <module>
May 23 10:37:17 myNode www[29247]:     from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:37:17 myNode www[29247]: ImportError: No module named flask
May 23 10:37:17 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:37:17 myNode systemd[1]: www.service: Failed with result 'exit-code'.
May 23 10:37:28 myNode systemd[1]: www.service: Service RestartSec=10s expired, scheduling restart.
May 23 10:37:28 myNode systemd[1]: www.service: Scheduled restart job, restart counter is at 14769.
May 23 10:37:28 myNode systemd[1]: Stopped myNode Web Server.
May 23 10:37:28 myNode systemd[1]: Started myNode Web Server.
May 23 10:37:29 myNode www[29280]: RESTART COUNT: 0 (PYTHON3)
May 23 10:37:29 myNode www[29280]: /var/www/mynode/mynode.py:3: DeprecationWarning: 'flask.Markup' is deprecated and will be removed in Flask 2.4. Import 'markupsafe.Markup' instead.
May 23 10:37:29 myNode www[29280]:   from flask import Flask, render_template, Markup, redirect, request, url_for
May 23 10:37:29 myNode www[29280]: Traceback (most recent call last):
May 23 10:37:29 myNode www[29280]:   File "/var/www/mynode/mynode.py", line 781, in <module>
May 23 10:37:29 myNode www[29280]:     @app.before_first_request
May 23 10:37:29 myNode www[29280]: AttributeError: 'Flask' object has no attribute 'before_first_request'
May 23 10:37:29 myNode systemd[1]: www.service: Main process exited, code=exited, status=1/FAILURE
May 23 10:37:29 myNode systemd[1]: www.service: Failed with result 'exit-code'.

These are the last couple of lines, from a log already 134.000 lines long. ;) Hope it helps!

This should be resolved a recent change. Future images should not have this issue.

#790 (comment)

Ok, thanks! And will you make an image for a new version 0.3.18 then โ€“ hopefully also including Core 25.0 and Dojo 1.20? ;)

Core 25.0 is planned. Dojo 1.20 may be in the next release.

This should be resolved a recent change. Future images should not have this issue.

#790 (comment)

About this commit you mentioned: does this mean the issue is resolved in 0.3.17 also? Does this mean, I can update from an older version to 0.3.17 now and this problem does not occur any more?

This would only effect newly created images when making one from a base image or starting from debian. It was temporarily a problem in an image I made and posted without realizing the issue, but those have been removed. New images will be made probably once v0.3.18 is out.

In other words: when flashing the image with version 0.3.05 and then updating to the current version 0.3.17 there will not be this error? Is this correctly understood?

Yeah, that's right @lasermind

New images were made for v0.3.18 for the Raspi 4 and PC.

Thanks in the name of all!

I'll try this out for PC, hopefully this week, and will also keep an eye on the issue #794 (Dojo default passwords).

Tried the PC image for 0.3.18 and can confirm: localhost serves the MyNode GUI again.

Closing here, thanks!