[Solved] 500 internal server error global (user, admin and web api(element)) /etc/ssowat/conf.json.persistent empty

My YunoHost server

Hardware: odroid hc1 lxd debian buster
YunoHost version: yunohost:
repo: stable
version: 4.3.4.1
yunohost-admin:
repo: stable
version: 4.3.2.3
moulinette:
repo: stable
version: 4.3.2.2
ssowat:
repo: stable
version: 4.3.2.2

I have access to my server : Through SSH no other way
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes ,

sudo yunohost settings set security.nginx.compatibility -v modern
sudo yunohost settings set security.ssh.compatibility -v modern
sudo yunohost settings set security.ssh.port -v XXX

Description of my issue

Http access imposible neither to user panel, admin panel or http-API 
nginx or ssowat  seems to be brokenn.

Tell me which log i can send

1 Like

As a starter, just sending the actual error message you’re seeing, or a screenshot of the error, would be very helpful

2 Likes

on all domain from web interface :
Screenshot from 2021-11-29 19-02-06

and no user can connect with element to synapse (from android as from web )
and calendar, contact and tasks can not be synced througth Nextcloud webdev.

diagnose tellme that no web ports (80 or 443) are reachable.

email works. and others ports
is there any proxy or thing like that aside nginx ?

I found that in the browser console:

GEThttps://home.3cmr.fr/

Content Security Policy: This site (https://home.3cmr.fr) has a Report-Only policy without a report URI. CSP will not block and cannot report violations of this policy.

Content Security Policy: This site (https://home.3cmr.fr) has a Report-Only policy without a report URI. CSP will not block and cannot report violations of this policy.

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

on the server :

tail -f /var/log/nginx/home.3cmr.fr-error.log
2021/11/30 00:06:34 [error] 22853#22853: *761 lua entry thread aborted: runtime error: /usr/share/ssowat/access.lua:23: attempt to call field ‘refresh_config’ (a nil value)
stack traceback:
coroutine 0:
/usr/share/ssowat/access.lua: in function </usr/share/ssowat/access.lua:1>, client: 181.202.32.132, server: home.3cmr.fr, request: “GET / HTTP/2.0”, host: “home.3cmr.fr

tail -f /var/log/nginx/matrx.3cmr.fr-error.log
2021/11/30 00:08:55 [error] 22853#22853: *699 lua entry thread aborted: runtime error: /usr/share/ssowat/access.lua:23: attempt to call field ‘refresh_config’ (a nil value)
stack traceback:
coroutine 0:
/usr/share/ssowat/access.lua: in function </usr/share/ssowat/access.lua:1>, client: ::1, server: matrx.3cmr.fr, request: “GET /_matrix/client/r0/account/whoami?user_id=%40whatsappbot%3A3cmr.fr HTTP/2.0”, host: “matrx.3cmr.fr
2021/11/30 00:08:56 [error] 22853#22853: *702 lua entry thread aborted: runtime error: /usr/share/ssowat/access.lua:23: attempt to call field ‘refresh_config’ (a nil value)
stack traceback:
coroutine 0:
/usr/share/ssowat/access.lua: in function </usr/share/ssowat/access.lua:1>, client: 181.202.33.41, server: matrx.3cmr.fr, request: “GET /_matrix/client/versions HTTP/2.0”, host: “matrx.3cmr.fr
2021/11/30 00:08:57 [error] 22853#22853: *702 lua entry thread aborted: runtime error: /usr/share/ssowat/access.lua:23: attempt to call field ‘refresh_config’ (a nil value)
stack traceback:
coroutine 0:
/usr/share/ssowat/access.lua: in function </usr/share/ssowat/access.lua:1>, client: 181.202.33.41, server: matrx.3cmr.fr, request: “GET /_matrix/client/versions HTTP/2.0”, host: “matrx.3cmr.fr

1 Like

What’s says you last diagnostic (you should have received it by email) ?

Can you check you have enough space on your partition ?

df -h
1 Like

diagnisis issue result :
https://paste.yunohost.org/raw/idopoziwah

df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/sdg-data  195G  110G   76G  60% /
none                  492K  4.0K  488K   1% /dev
udev                  925M     0  925M   0% /dev/tty
tmpfs                 100K     0  100K   0% /dev/lxd
tmpfs                 100K     0  100K   0% /dev/.lxd-mounts
tmpfs                 996M   12K  996M   1% /dev/shm
tmpfs                 996M   14M  982M   2% /run
tmpfs                 5.0M     0  5.0M   0% /run/lock
tmpfs                 996M     0  996M   0% /sys/fs/cgroup
tmpfs                 200M     0  200M   0% /run/user/1007

I came back to intermediate in security.nginx.compatibility config and no change.

1 Like

Sounds related to /etc/ssowat/conf.json or /etc/ssowat/conf.json.persistent … Could it be that you tweaked (or deleted) one of those files before the issue started to appear

Actually, what did you do right before the error started to appear …

1 Like

Yes now i remember I tryed to modify /etc/ssowat/conf.json but back to the original.
Can i compare origninal and mine.
And etc/ssowat/conf.json.persistent is empty

1 Like

I guess you can try to run yunohost app ssowatconf to regen the ssowat conf …

1 Like

I tried it before but did nothing
now i run yunohost app ssowatconf --debug and not working

395  DEBUG initializing base actions map parser for cli
402  DEBUG loading actions map namespace 'yunohost'
411  DEBUG building parser...
450  DEBUG building parser took 0.038s
453  DEBUG acquiring lock...
508  DEBUG lock has been acquired
547  DEBUG loading python module yunohost.app took 0.038s
548  DEBUG processing action [916.1]: yunohost.app.ssowatconf with args={}
740  DEBUG initializing ldap interface
1210 DEBUG action [916.1] executed in 0.661s
1213 DEBUG lock has been released
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 72, in <module>
    parser=parser
  File "/usr/lib/moulinette/yunohost/__init__.py", line 25, in cli
    ret = moulinette.cli(args, output_as=output_as, timeout=timeout, top_parser=parser)
  File "/usr/lib/python3/dist-packages/moulinette/__init__.py", line 131, in cli
    args, output_as=output_as, timeout=timeout
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/cli.py", line 496, in run
    ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 597, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/app.py", line 1465, in app_ssowatconf
    translate_legacy_rules_in_ssowant_conf_json_persistent()
  File "/usr/lib/moulinette/yunohost/utils/legacy.py", line 191, in translate_legacy_rules_in_ssowant_conf_json_persistent
    if not any(legacy_rule in persistent for legacy_rule in legacy_rules):
  File "/usr/lib/moulinette/yunohost/utils/legacy.py", line 191, in <genexpr>
    if not any(legacy_rule in persistent for legacy_rule in legacy_rules):
TypeError: argument of type 'NoneType' is not iterable
1 Like

Then i’m guessing that your problem is that /etc/ssowat/conf.json.persistent shouldn’t be empty, it should contain at least {}

1 Like

humm ok i put {} in sowat conf persistant the error disapeard running yunohost app ssowatconf --debug
but 500 Internal Server Error nginx is always present.

382  DEBUG initializing base actions map parser for cli
388  DEBUG loading actions map namespace 'yunohost'
397  DEBUG building parser...
437  DEBUG building parser took 0.039s
440  DEBUG acquiring lock...
507  DEBUG lock has been acquired
547  DEBUG loading python module yunohost.app took 0.040s
548  DEBUG processing action [1280.1]: yunohost.app.ssowatconf with args={}
746  DEBUG initializing ldap interface
1197 DEBUG SSOwat configuration regenerated
1199 DEBUG action [1280.1] executed in 0.650s
1200 DEBUG lock has been released
1 Like

And just to make sure, did you keep the {} in conf.json.persistent after you fixed the error ?

1 Like

cat /etc/ssowat/conf.json.persistent
{}

1 Like

Theeeen let’s try a full restart of nginx :

systemctl restart nginx
1 Like

:hushed: :hugs: :+1:+thank you
i tried all but not in the right order

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.