Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[swag-dashboard] Empty list of proxies in dashboard #606

Closed
tenfourty opened this issue Mar 21, 2023 · 18 comments
Closed

[swag-dashboard] Empty list of proxies in dashboard #606

tenfourty opened this issue Mar 21, 2023 · 18 comments
Assignees

Comments

@tenfourty
Copy link

I'm using Swag Auto Proxy for most of my proxies (except one) and none of my proxies are showing up in the dashboard.

Is this a known issue or due to a misconfiguration on my side?

Screenshot 2023-03-21 at 10 37 38

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@tenfourty
Copy link
Author

Hi, this issue hasn't gone away yet. Is there anything I can do to provide more info to help debug it?

@armouredking
Copy link

I can also confirm this behaviour. The only thing I did to cause it was to perform a pull on docker compose as I wanted to update the "out of date" template files. Following that, I started receiving the following error messages (sanitised to remove domain and ip address):

2023/05/30 19:28:49 [error] 2050#2050: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /dashboard/www/index.php on line 54" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: dash.example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "dash.example.com"
2023/05/30 19:34:57 [error] 528#528: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /dashboard/www/index.php on line 54" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: dash.example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "dash.example.com"
2023/05/30 19:36:21 [error] 528#528: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /dashboard/www/index.php on line 54" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: dash.example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "dash.example.com"
2023/05/30 19:36:28 [error] 528#528: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /dashboard/www/index.php on line 54" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: dash.example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "dash.example.com"
2023/05/30 19:38:11 [error] 531#531: *163 FastCGI sent in stderr: "PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /dashboard/www/index.php on line 54" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: dash.example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "dash.example.com"
2023/05/30 19:38:16 [error] 532#532: *168 FastCGI sent in stderr: "PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /dashboard/www/index.php on line 54" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: dash.example.com, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "dash.example.com"

I'm not sure what versions I moved between when doing the pull as I typically use latest tags for this docker compose suite. Line 54 of index.php is a section of function GetProxies() doing a foreach of $data, not sure where the dashboard is storing the data but it seems like it isn't pulling anything in.

@adampaynetech
Copy link

I am also getting the exact same issues described. with the same PHP warnings.

@aptalca
Copy link
Member

aptalca commented May 31, 2023

Can you guys post a list of the active proxy confs you have, so we can try and narrow down the list a bit?

docker exec swag bash -c 'ls /config/nginx/proxy-confs/*.conf'

And if you have the auto-proxy mod, also post the output of
docker exec swag bash -c 'ls /etc/nginx/http.d/*.conf'

And before that, make sure that the SWAG log does not list any out of date confs

@armouredking
Copy link

I am not using auto-proxy. I am using swag-dashboard, and swag-maxmind if it matters. All my confs are updated, including for the update that happened today (did another pull just to see if it would change things).

Current image id: 90ec6e110ba1445329665d8664c71ef4830c0ca4e8ef17146fb2d9474c8dd043

Result of proxy confs:

/config/nginx/proxy-confs/authelia.subdomain.conf   /config/nginx/proxy-confs/calibre-web.subdomain.conf  /config/nginx/proxy-confs/papermerge.subdomain.conf
/config/nginx/proxy-confs/bookstack.subdomain.conf  /config/nginx/proxy-confs/dashboard.subdomain.conf

To note, it was displaying for me prior to updating late this month (based on container images left behind I'm going to guess it was this one? 93ad0b6ae8d982f2b9677b84e208c70c9ecd2c1b05f94ca837d307f26cde9dc3 or this also ccefd194fe1fe4194be9ddb99f9df14c8338cba40f897b0c6fba35d3530e6131, don't have the one from February anymore though), and it appears the last up date time for my files / container was sometime in February as the version date on the conf files was dated from then.

@armouredking
Copy link

armouredking commented May 31, 2023

Just as an extra bit of troubleshooting, I removed all my configured conf files by renaming them to sample1 and let it pull a new dashboard config proxy file. With no proxies loaded (besides the dashboard, which is now a fresh from repo pull in case it had a space or something out of place), I still receive the foreach() argument error (when attempting to access dashboard.* url).

@aptalca
Copy link
Member

aptalca commented May 31, 2023

It's looking like it's an issue with the mod and not specific to a proxy conf. The dev is looking into it.

Thanks

@armouredking
Copy link

In case it helps: I am able to run the script from the dashboard mod with python3 swag-proxies.py from container CMD and receive a result. A typical result (with all my stuff turned on again):

root@90ec6e110ba1:/dashboard# python3 swag-proxies.py
{"http://authelia:9091/": {"locations": ["/config/nginx/proxy-confs/authelia.subdomain.conf"], "status": true}, "http://bookstack:80/": {"locations": ["/config/nginx/proxy-confs/bookstack.subdomain.conf"], "status": true}, "http://calibre_web:8083/": {"locations": ["/config/nginx/proxy-confs/calibre-web.subdomain.conf"], "status": true}, "http://email_autodiscover:8000/": {"locations": ["/config/nginx/personal-confs/monogramm.subdomain.enable.conf"], "status": false}, "http://paperless:8000/": {"locations": ["/config/nginx/proxy-confs/papermerge.subdomain.conf"], "status": true}, "http://shlink_backend:8080/": {"locations": ["/config/nginx/personal-confs/links.enable.conf"], "status": true}, "http://shlink_frontend:80/": {"locations": ["/config/nginx/personal-confs/links.enable.conf"], "status": true}}

Perhaps something on the HTML/PHP side then? I tried looking through the file history but didn't see any obvious changes that would impact the array but I admittedly don't know much.

I don't remember if Shlink or Monogramm were showing up before when things were still working, so just in case I went ahead and removed those (changing it to .disabled.conf doesn't appear to impact the python script, maybe it should?) and tried again (since it isn't in the proxy folder it wasn't part of my original test, I keep my personal configurations in a different folder to separate them from the default stuff that comes with swag) but removing those configurations also had no impact on the dashboard displaying results, despite changing the python script output as expected.

@aptalca
Copy link
Member

aptalca commented Jun 1, 2023

We identified the issue. It has to do with the use of venv, which is kind of required with python 3.11
We're working on a fix

@armouredking
Copy link

I can confirm that PR #716 fixes the missing proxy issue for me.

@armouredking
Copy link

@tenfourty It looks like PR #716 was applied a few days ago, and I just executed a re-pull of the image and my SWAG Dashboard Proxy list is working again (no need for edits manually). If you haven't tried yet give it a go and maybe close out the issue?

@tenfourty
Copy link
Author

@tenfourty It looks like PR #716 was applied a few days ago, and I just executed a re-pull of the image and my SWAG Dashboard Proxy list is working again (no need for edits manually). If you haven't tried yet give it a go and maybe close out the issue?

Unfortunately, I still have the same issue even after updating and resetting the conf file.

How can I help debug the issue?

@aptalca
Copy link
Member

aptalca commented Jun 26, 2023

I still have the same issue even after updating and resetting the conf file.

I don't know what you mean by that. Which conf file are you referring to?

You need to restart SWAG and it should download the new mod, which has the fix.

@tenfourty
Copy link
Author

You need to restart SWAG and it should download the new mod, which has the fix.

Yes, that is what I've done. I think the issue I'm experiencing is because I'm using Swag Auto Proxy. Is there anything I can do to provide debug info?

@aptalca
Copy link
Member

aptalca commented Jun 27, 2023

Open a new issue and fill out the template

@aptalca aptalca closed this as completed Jun 27, 2023
@tenfourty
Copy link
Author

Ugh... I tried to create an issue and there is no default template and I can't see any docs on what you want.

@aptalca
Copy link
Member

aptalca commented Jun 27, 2023

My bad. The mod repo doesn't have an issue template. We need the following:
System details (hardware, arch, distro)
How you installed docker
How you created the container (docker run, compose yaml or screenshots)
Full container log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants