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

NextCloud Integration error: 502 Bad Gateway for healthcheck #1039

Open
farewarr opened this issue Nov 13, 2024 · 1 comment
Open

NextCloud Integration error: 502 Bad Gateway for healthcheck #1039

farewarr opened this issue Nov 13, 2024 · 1 comment

Comments

@farewarr
Copy link

farewarr commented Nov 13, 2024

Nextcloud integration with OnlyOffice fails due to the following nextcloud errror:

###Error from Nextcloud:

Error onlyoffice ServerExceptionServer error: GET https://onlyoffice.nonooculusnas.com/healthcheck resulted in a 502 Bad Gateway response: <title>502 Bad Gateway</title>

502 Bad Gateway


ngin (truncated...)healthcheckRequest on check error
  • Error is seen when clicking save on the integration settings and in the nextcloud logs page.

###NGINX logs from onlyoffice:
nginx logs again: 2024/11/13 05:52:13 [error] 755#755: *2 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:52:13 [error] 755#755: *2 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:52:25 [error] 755#755: *5 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:52:25 [error] 755#755: *5 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:52:52 [error] 755#755: *8 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:52:52 [error] 755#755: *8 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:53:42 [error] 755#755: *13 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "POST /ConvertService.ashx HTTP/1.1", upstream: "http://127.0.0.1:8000/ConvertService.ashx", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:53:42 [error] 755#755: *13 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "POST /ConvertService.ashx HTTP/1.1", upstream: "http://127.0.0.1:8000/ConvertService.ashx", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:53:45 [error] 755#755: *16 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "POST /ConvertService.ashx HTTP/1.1", upstream: "http://127.0.0.1:8000/ConvertService.ashx", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:53:45 [error] 755#755: *16 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "POST /ConvertService.ashx HTTP/1.1", upstream: "http://127.0.0.1:8000/ConvertService.ashx", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:54:23 [error] 755#755: *21 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "HEAD /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:54:23 [error] 755#755: *21 connect() failed (111: Unknown error) while connecting to upstream, client: 172.25.0.1, server: , request: "HEAD /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice.nonooculusnas.com" 2024/11/13 05:59:54 [error] 1552#1552: *34 connect() failed (111: Unknown error) while connecting to upstream, client: 127.0.0.1, server: , request: "HEAD /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "localhost" 2024/11/13 05:59:54 [error] 1552#1552: *34 connect() failed (111: Unknown error) while connecting to upstream, client: 127.0.0.1, server: , request: "HEAD /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "localhost" 2024/11/13 06:02:01 [error] 1552#1552: *41 connect() failed (111: Unknown error) while connecting to upstream, client: 127.0.0.1, server: , request: "HEAD /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "127.0.0.1" 2024/11/13 06:02:01 [error] 1552#1552: *41 connect() failed (111: Unknown error) while connecting to upstream, client: 127.0.0.1, server: , request: "HEAD /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "127.0.0.1"

It seems that https:///healthcheck is being checked on port 8000 even though the port config in compose file uses port 80

###Compose File:

version: "3.9"
services:
onlyoffice:
image: onlyoffice/documentserver:latest
container_name: onlyoffice-server
hostname: OnlyOfficeServer
networks:
- nextcloud_network
ports:
- 8467:80
volumes:
- /volume1/docker/onlyoffice/logs:/var/log/onlyoffice:rw
- /volume1/docker/onlyoffice/data:/var/www/onlyoffice/Data:rw
- /volume1/docker/onlyoffice/config:/etc/onlyoffice/documentserver/:rw
environment:
JWT_ENABLED: true
JWT_SECRET: secret
rejectUnauthorized: false
restart: always
labels:
- com.centurylinklabs.watchtower.enable=true

networks:
nextcloud_network:
external: true

###from default.json we see coauthoring port is 8000
"services": {
"CoAuthoring": {
"server": {
"port": 8000,
"workerpercpu": 1,
"mode": "development",
"limits_tempfile_upload": 104857600,
"limits_image_size": 26214400,
"limits_image_download_timeout": {
"connectionAndInactivity": "2m",
"wholeCycle": "2m"
},

###Curl Command:
ash-4.4# curl -I http://:80/healthcheck
HTTP/1.1 502 Bad Gateway
Server: nginx
Date: Wed, 13 Nov 2024 06:18:43 GMT
Content-Type: text/html
Content-Length: 150
Connection: keep-alive

###curl command ran from inside container:
ash-4.4# docker exec -it onlyoffice-server curl -I http://127.0.0.1:80/healthcheck
HTTP/1.1 502 Bad Gateway
Server: nginx
Date: Wed, 13 Nov 2024 06:18:43 GMT
Content-Type: text/html
Content-Length: 150
Connection: keep-alive

Downgrading to onlyoffice/documentserver:8.2.0 resolved the issue. As of this post the 'latest' tag was updated 16 hours ago.

###Curl command ran after downgrading:
ash-4.4# curl -I http://onlyoffice.nonooculusnas.com:80/healthcheck
HTTP/1.1 404 Not Found
Server: nginx
Date: Wed, 13 Nov 2024 06:51:37 GMT
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Keep-Alive: timeout=20
Vary: Accept-Encoding

I did not know to check this before the issue started and even though its coming back 404 not found, the integration in nextcloud is now working.

Also, I am not sure if the coauthoring port is correct or not, but the main issue here is the healthceck url is coming back as 502 bad gateway.

@Carazyda Carazyda transferred this issue from ONLYOFFICE/CommunityServer Nov 13, 2024
@igwyd
Copy link
Member

igwyd commented Nov 29, 2024

Also, I am not sure if the coauthoring port is correct or not, but the main issue here is the healthceck url is coming back as 502 bad gateway.

I get your docker compose file, by the way, it has mistakes:

  1. Forbidden to create volume /volume1/docker/onlyoffice/config:/etc/onlyoffice/documentserver/:rw
  2. We havent variable rejectUnauthorized: false, use instead USE_UNAUTHORIZED_STORAGE, all configuration parameters here https://github.com/ONLYOFFICE/Docker-DocumentServer?tab=readme-ov-file#available-configuration-parameters

Ran curl inside container:
root@OnlyOfficeServer:/# curl -I http://127.0.0.1:80/healthcheck
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 29 Nov 2024 06:12:29 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 4
Connection: keep-alive
ETag: W/"4-X/5TO4MPCKAyY0ipFgr6/IraRNs"

And outside (Port 8467 because you map it 8467:80)
root@oods:~/NC-test# curl -I http://ip-address:8467/healthcheck
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 29 Nov 2024 06:15:10 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 4
Connection: keep-alive
ETag: W/"4-X/5TO4MPCKAyY0ipFgr6/IraRNs"

Everything is ok as you see.

I see you are using an external DNS for request https://onlyoffice.nonooculusnas.com/healthcheck. Is there some proxy before onlyoffice? I think the issue should be there.

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

2 participants