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

Install with docker compose results in error "502 Bad Gateway" #97

Closed
tanrak opened this issue Mar 7, 2024 · 11 comments
Closed

Install with docker compose results in error "502 Bad Gateway" #97

tanrak opened this issue Mar 7, 2024 · 11 comments

Comments

@tanrak
Copy link

tanrak commented Mar 7, 2024

Hi, i would like to test this promising tool. But the installation with docker compose on my arm64 device results in an nginx error "502 Bad Gateway".

@redimp
Copy link
Owner

redimp commented Mar 7, 2024

Hey @tanrak, please provide some additional information.

For the most minimal test please run

docker run -p 8080:80 -it --rm redimp/otterwiki:2

Check http://127.0.0.1 and share the output here.

@tanrak
Copy link
Author

tanrak commented Mar 7, 2024

It works when I run the browser (http://127.0.0.1;8080) on the same computer that Docker is running on. When I access the server/docker (192.168.yyy.yyy:8080) from another computer (192.168.xxx.xxx), the error mentioned above appears.

Here is the output:
2024/03/07 21:26:14 [error] 18#18: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.xxx.xxx, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi.sock:", host: "192.168.yyy.yyy:8080"

@shangri26199
Copy link
Contributor

Could you give more details about the otter wiki host (OS?), your docker version and the ip addresses used? Since they are local they aren't critical.

@redimp
Copy link
Owner

redimp commented Mar 7, 2024

Hm, not sure what is happening here. Lets rule out if the uwsgi is part of the problem. Please run a plain nginx

docker run -it --rm -p 8080:80 nginx:1.25.3

and check if you can reach this from a) localhost and b) another computer.

@tanrak
Copy link
Author

tanrak commented Mar 8, 2024

I have run some tests. It seems the error is platform dependent...

amd64:

docker run -p 8080:80 -it --rm redimp/otterwiki:2

  • works from localhost
  • works from another computer

docker run -it --rm -p 8080:80 nginx:1.25.3

  • works from localhost
  • another computer shows the nginx welcome page

arm64:

docker run -p 8080:80 -it --rm redimp/otterwiki:2

  • works from localhost
  • another computer shows 502 Bad Gateway

docker run -it --rm -p 8080:80 nginx:1.25.3

  • works from localhost
  • another computer shows the nginx welcome page

While researching the error, i found this page. I made the change (add buffer-size=65535) in the file uwsgi.ini and built the image myself. And now it finally works on my arm64 (Raspberry Pi OS Debian 10 Buster) system!

@shangri26199
Copy link
Contributor

Nice to see you were able to fix this yourself. To prevent this from happening to other users we would like to test this ourselfs. Could you still provide us the information?
Also it would be nice to know what your client is running on. Since your header seems to be way bigger than usual.

@redimp
Copy link
Owner

redimp commented Mar 8, 2024

Awesome! Thank you for sharing the solution. Will try to reproduce this.

And now it finally works on my arm64 (Raspberry Pi OS Debian 10 Buster) system!

Obviously I missed to test this combinaton. I've tested the otterwiki only on Debian 11 Bullseye on Raspberry Pi 1B, and and Debian 12 Bookworm on the Pi 4B and 5.

Which docker --version are you runnning? (Or podman version, or ...)

@tanrak
Copy link
Author

tanrak commented Mar 8, 2024

Here is some more information. It seems not really be platform-dependent but browser-dependent.
The "502 Bad Gateway" only appears at Firefox (Windows 10)! On Edge (Windows 10) it works. And it works also on Android with Firefox!?

Edit:
Raspberry Pi 4 with Raspbery Pi OS (Debian 10 Buster)
Docker version 25.0.3, build 4debf41

@redimp
Copy link
Owner

redimp commented Mar 8, 2024

I think we are getting closer to the cause of the problem. I'm unfortunaley not a browser expert. Which Firefox version is causing the problem?

The uwsgi default is buffer-size: 4k.

Can you do some more testing and configure it to

buffer-size=8192

and if this still breaks to

buffer-size=16384

@tanrak
Copy link
Author

tanrak commented Mar 8, 2024

Oh dear. It seems that the problem is related to my current Firefox profile.

  • temporary installed Firefox Portable for testing: it works
  • current Firefox profile (default Browser): doesn't work (request block size always around 5400 which is bigger than the default 4k)
  • Firefox in Safe mode with current Firefox profile (default Browser): doesn't work (request block size always around 5400 which is bigger than the default 4k)
  • new Firefox profile (default Browser): it works

Image with buffer-size=8192 works. The request block size is always around 5400 at my "broken" Firefox profile.

Edit: Sorry for the noise. I'll now take care of the Firefox profile.

EditEdit: After testing the software a bit, i have to say that the Otter Wiki is outstanding. It feels a bit like a lightweight DokuWiki with Markdown syntax. Thanks for it!

@redimp
Copy link
Owner

redimp commented Mar 8, 2024

Thank you for sharing this!

EditEdit: After testing the software a bit, i have to say that the Otter Wiki is outstanding. It feels a bit like a lightweight DokuWiki with Markdown syntax. Thanks for it!

🥳

@redimp redimp closed this as completed Mar 8, 2024
eifelmicha added a commit to Schmitzis/otterwiki that referenced this issue May 18, 2024
eifelmicha added a commit to Schmitzis/otterwiki that referenced this issue Jun 29, 2024
eifelmicha added a commit to Schmitzis/otterwiki that referenced this issue Nov 9, 2024
eifelmicha added a commit to Schmitzis/otterwiki that referenced this issue Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants