No internet connection
  1. Home
  2. Technical Support

missing flask

By @derdast
    2021-12-10 16:48:20.295Z

    This topic exists and there is no solution?

    Dec 10 16:30:46 tinypilot1 systemd[1]: Started TinyPilot - RPi-based virtual KVM.
    Dec 10 16:30:47 tinypilot1 python[976]: [2021-12-10 16:30:47,453] INFO in main: Starting app
    Dec 10 16:30:47 tinypilot1 python[976]: Traceback (most recent call last):
    Dec 10 16:30:47 tinypilot1 python[976]: File "app/main.py", line 46, in
    Dec 10 16:30:47 tinypilot1 python[976]: SECRET_KEY=secret_key.get_or_create(),
    Dec 10 16:30:47 tinypilot1 python[976]: File "/opt/tinypilot/app/secret_key.py", line 101, in get_or_create
    Dec 10 16:30:47 tinypilot1 python[976]: return _get()
    Dec 10 16:30:47 tinypilot1 python[976]: File "/opt/tinypilot/app/secret_key.py", line 54, in _get
    Dec 10 16:30:47 tinypilot1 python[976]: 'The secret key file must have a file permission of 600.')
    Dec 10 16:30:47 tinypilot1 python[976]: secret_key.InvalidSecretKeyError: The secret key file must have a file permission of 600.
    Dec 10 16:30:47 tinypilot1 systemd[1]: tinypilot.service: Main process exited, code=exited, status=1/FAILURE
    Dec 10 16:30:47 tinypilot1 systemd[1]: tinypilot.service: Failed with result 'exit-code'.
    Dec 10 16:30:47 tinypilot1 systemd[1]: tinypilot.service: Service RestartSec=100ms expired, scheduling restart.
    Dec 10 16:30:47 tinypilot1 systemd[1]: tinypilot.service: Scheduled restart job, restart counter is at 182.
    Dec 10 16:30:47 tinypilot1 systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
    Dec 10 16:30:47 tinypilot1 systemd[1]: Started TinyPilot - RPi-based virtual KVM.
    Dec 10 16:30:48 tinypilot1 python[977]: [2021-12-10 16:30:48,762] INFO in main: Starting app
    Dec 10 16:30:48 tinypilot1 python[977]: Traceback (most recent call last):
    Dec 10 16:30:48 tinypilot1 python[977]: File "app/main.py", line 46, in
    Dec 10 16:30:48 tinypilot1 python[977]: SECRET_KEY=secret_key.get_or_create(),
    Dec 10 16:30:48 tinypilot1 python[977]: File "/opt/tinypilot/app/secret_key.py", line 101, in get_or_create
    Dec 10 16:30:48 tinypilot1 python[977]: return _get()
    Dec 10 16:30:48 tinypilot1 python[977]: File "/opt/tinypilot/app/secret_key.py", line 54, in _get
    Dec 10 16:30:48 tinypilot1 python[977]: 'The secret key file must have a file permission of 600.')
    Dec 10 16:30:48 tinypilot1 python[977]: secret_key.InvalidSecretKeyError: The secret key file must have a file permission of 600.
    Dec 10 16:30:48 tinypilot1 systemd[1]: tinypilot.service: Main process exited, code=exited, status=1/FAILURE
    Dec 10 16:30:48 tinypilot1 systemd[1]: tinypilot.service: Failed with result 'exit-code'.
    Dec 10 16:30:49 tinypilot1 systemd[1]: tinypilot.service: Service RestartSec=100ms expired, scheduling restart.
    Dec 10 16:30:49 tinypilot1 systemd[1]: tinypilot.service: Scheduled restart job, restart counter is at 183.
    Dec 10 16:30:49 tinypilot1 systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.

    http://logs.tinypilotkvm.com/vAPvoN3x

    Solved in post #2, click to view
    • 8 replies
    1. Thanks for reporting this?

      It looks like the web server is refusing to start because the permissions are incorrect on /home/tinypilot/.flask-secret-key

      Do you know of anything that would have changed the permissions?

      You should be able to fix this by running:

      sudo chmod 600 /home/tinypilot/.flask-secret-key
      
      1. D
        In reply toderdast:
        @derdast
          2021-12-10 16:55:22.487Z

          root@tinypilot1:~# ls -al /home/tinypilot/.flask-secret-key
          -rw-r--r-- 1 root root 1666 Mar 25 2021 /home/tinypilot/.flask-secret-key
          root@tinypilot1:~# chmod 600 /home/tinypilot/.flask-secret-key
          root@tinypilot1:~# ls -al /home/tinypilot/.flask-secret-key
          -rw------- 1 root root 1666 Mar 25 2021 /home/tinypilot/.flask-secret-key
          root@tinypilot1:~#

          1. D
            In reply toderdast:
            @derdast
              2021-12-10 16:55:55.771Z

              I did an update via the web page, with this result

              1. D
                In reply toderdast:
                @derdast
                  2021-12-10 17:00:40.724Z

                  Dec 10 17:00:18 tinypilot1 python[847]: [2021-12-10 17:00:18,692] INFO in main: Starting app
                  Dec 10 17:00:18 tinypilot1 python[847]: [2021-12-10 17:00:18,695] INFO in secret_key: Creating new flask secret key at /home/tinypilot/.flas
                  k-secret-key
                  Dec 10 17:00:18 tinypilot1 python[847]: Traceback (most recent call last):
                  Dec 10 17:00:18 tinypilot1 python[847]: File "/opt/tinypilot/app/secret_key.py", line 101, in get_or_create
                  Dec 10 17:00:18 tinypilot1 python[847]: return _get()
                  Dec 10 17:00:18 tinypilot1 python[847]: File "/opt/tinypilot/app/secret_key.py", line 50, in _get
                  Dec 10 17:00:18 tinypilot1 python[847]: with open(_SECRET_KEY_FILE, 'rb') as key_file:
                  Dec 10 17:00:18 tinypilot1 python[847]: PermissionError: [Errno 13] Permission denied: '/home/tinypilot/.flask-secret-key'
                  Dec 10 17:00:18 tinypilot1 python[847]: During handling of the above exception, another exception occurred:
                  Dec 10 17:00:18 tinypilot1 python[847]: Traceback (most recent call last):
                  Dec 10 17:00:18 tinypilot1 python[847]: File "app/main.py", line 46, in
                  Dec 10 17:00:18 tinypilot1 python[847]: SECRET_KEY=secret_key.get_or_create(),
                  Dec 10 17:00:18 tinypilot1 python[847]: File "/opt/tinypilot/app/secret_key.py", line 103, in get_or_create
                  Dec 10 17:00:18 tinypilot1 python[847]: return _create()
                  Dec 10 17:00:18 tinypilot1 python[847]: File "/opt/tinypilot/app/secret_key.py", line 75, in _create
                  Dec 10 17:00:18 tinypilot1 python[847]: with open(_SECRET_KEY_FILE, 'wb') as key_file:
                  Dec 10 17:00:18 tinypilot1 python[847]: PermissionError: [Errno 13] Permission denied: '/home/tinypilot/.flask-secret-key'

                  1. D
                    In reply toderdast:
                    @derdast
                      2021-12-10 17:01:00.258Z

                      Now it is not able to read it at all

                      1. In reply toderdast:

                        Hmm, not sure how it got out of whack like that. You can just remove it and let Flask recreate the file:

                        sudo rm /home/tinypilot/.flask-secret-key
                        
                        1. D
                          In reply toderdast:
                          @derdast
                            2021-12-10 17:21:14.741Z

                            Unfortunately it seems dead now
                            I did a reboot from the command and it does not come up again
                            I already ask for download of an SD Image
                            I bought the tinypilot from https://www.kvm-ip.de/

                            1. Okay, got your email. We'll email you the new image. Sorry for the inconvenience. I'm not sure how the update mangled those permissions.