500: Internal server error on http://zynthian.local/, any path like http://zynthian.local/lib-captures/ works

Sorry, it seems like I haven’t used Github for so long, I can’t get past the 2 factor authentication..

As described in the title, I get a 500 Internal Server Error after login to webconf. This is only for the root directory and /sw-repos/ AFAICT. Log shows:

DEBUG:root:Loaded engine config with timestamp: 1763379474.1524427
fatal: detected dubious ownership in repository at '/zynthian/zynthian-sys'
To add an exception for this directory, call:

        git config --global --add safe.directory /zynthian/zynthian-sys
ERROR:tornado.application:Uncaught exception GET / (192.168.1.127)
HTTPServerRequest(protocol='http', host='zynthian.local', method='GET', uri='/', version='HTTP/1.1', remote_ip='192.168.1.127')
Traceback (most recent call last):
  File "/zynthian/venv/lib/python3.11/site-packages/tornado/web.py", line 1788, in _execute
    result = method(*self.path_args, **self.path_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/zynthian/venv/lib/python3.11/site-packages/tornado/web.py", line 3301, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/zynthian/zynthian-webconf/lib/dashboard_handler.py", line 49, in get
    git_info_sys = self.get_git_info("/zynthian/zynthian-sys")
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/zynthian/zynthian-webconf/lib/dashboard_handler.py", line 280, in get_git_info
    branch = check_output("cd %s; git branch | grep '*'" %
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'cd /zynthian/zynthian-sys; git branch | grep '*'' returned non-zero exit status 1.
ERROR:tornado.access:500 GET / (192.168.1.127) 40.20ms


[from shell]

(venv) root@zynthian:/zynthian/zynthian-sys# ls -al
total 76
drwxr-xr-x  9 zynthian zynthian  4096 May 26 15:05 .
drwxr-xr-x 12 zynthian zynthian  4096 Oct 21  2024 ..
drwxr-xr-x  2 zynthian zynthian  4096 May 26 15:03 boot
drwxr-xr-x  4 zynthian zynthian  4096 Jun 16 16:45 config
drwxr-xr-x  5 zynthian zynthian  4096 Sep  6  2024 custom
drwxr-xr-x 18 zynthian zynthian  4096 May 26 15:03 etc
drwxr-xr-x  8 zynthian zynthian  4096 Jun 16 16:45 .git
-rw-r--r--  1 zynthian zynthian 35147 Sep  6  2024 LICENSE.txt
-rw-r--r--  1 zynthian zynthian   780 Sep  6  2024 README.md
drwxr-xr-x  2 zynthian zynthian  4096 Jun  1 10:49 sbin
drwxr-xr-x  3 zynthian zynthian  4096 Jun 16 16:45 scripts
(venv) root@zynthian:/zynthian/zynthian-sys# git -C . branch
fatal: detected dubious ownership in repository at '/zynthian/zynthian-sys'
To add an exception for this directory, call:

        git config --global --add safe.directory /zynthian/zynthian-sys

I’m on oram development branch. I don’t know how I can see the versions from the webconf since I’m not able to load that page. Any idea on how I can fix this?

Could you please explain the circumstances where this occurs? Are you trying to run an update, on your Zynthian or are you trying to actually perform these git actions yourself?

I have no clue as to whether or not this is a good idea, but have you tried doing what the program suggested (twice):

Thank you for your reply. This happens when I try to access Webconf via the web browser, just after login. It happens every time.

It has been like this for a while, not sure when it occurred the first time. I have since the first occurrence run update_zynthian.sh to update the system, which works fine.

It (of course) originates from the /zynthian/zynthian-sys/ directory being owned by the zynthian user. I could try with the command that is suggested in the output, and that would probably solve the issue.

What I am certain of is that I haven’t caused the issue myself by changing permissions or something like that, so I just want to make sure that things are as they should. When checking ownership of the other directories in the /zynthian dir, it looks like this:

(venv) root@zynthian:/zynthian# ls -al
total 52
drwxr-xr-x 12 zynthian zynthian 4096 Oct 21  2024 .
drwxr-xr-x 19 root     root     4096 Oct  9  2024 ..
-rw-r--r--  1 root     root       89 Oct  2  2024 build_info.txt
drwxr-xr-x  8 zynthian zynthian 4096 Sep 30 22:11 config
drwxr-xr-x  6 root     root     4096 Sep  6  2024 venv
drwxr-xr-x  5 root     root     4096 Nov 17 16:07 zyncoder
drwxr-xr-x 15 root     root     4096 Jul 14 19:11 zynthian-data
drwxr-xr-x 10 zynthian zynthian 4096 Sep  6  2024 zynthian-my-data
drwxr-xr-x  4 root     root     4096 Sep  8  2024 zynthian-plugins
drwxr-xr-x 10 root     root     4096 May 26 15:05 zynthian-sw
drwxr-xr-x  9 zynthian zynthian 4096 May 26 15:05 zynthian-sys
drwxr-xr-x 14 root     root     4096 Sep 30 22:11 zynthian-ui
drwxr-xr-x 14 root     root     4096 Nov 22 21:01 zynthian-webconf

That zynthian-my-data/ and config/ are owned by the zynthian user is perhaps more understandable, but maybe not the zynthian-sys/ one. Is it just my system that looks like this? Should I do a chown -R or the git command..?

Well, if it’s any help, here’s my system, screencap of webconf with ssh to root in front of it:

It’s a fairly fresh download of Oram.

That definitely helped, thank you! :grin:

I chown’ed the directories to root and the problem disappeared. Wonder what caused it to change owner, but I guess I’ll never know :flushed_face:

Thanks again!

1 Like