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

ECONNREFUSED 127.0.1.1:80 #360

Closed
ToontjeM opened this issue Feb 11, 2025 · 3 comments
Closed

ECONNREFUSED 127.0.1.1:80 #360

ToontjeM opened this issue Feb 11, 2025 · 3 comments

Comments

@ToontjeM
Copy link

ToontjeM commented Feb 11, 2025

Yes, i am running on HTTP instead of HTTPS. It's fully local here in my lab and i am the only user. ;-)

Backend running.
Whenever i want to access a whiteboard file i get FetchError: http://mynextcloudurl/index.php/apps/whiteboard/number failed, reason ECONNREFUSED 127.0.1.1:80

Native install on Ubuntu 22.04, UFW disabled.
Whiteboard 1.0.5
Admin tells me all is okeydokey. Whiteboard backend server is configured and connected.

Should i add 127.0.1.1 to the list of authorised domains, maybe? Ignore the message?

Container log:

ton@nextcloud:~/whiteboard$ sudo docker-compose up
Starting whiteboard_nextcloud-whiteboard-server_1 ... done
Attaching to whiteboard_nextcloud-whiteboard-server_1
nextcloud-whiteboard-server_1  | 
nextcloud-whiteboard-server_1  | > whiteboard@1.0.5 server:start
nextcloud-whiteboard-server_1  | > node websocket_server/main.js
nextcloud-whiteboard-server_1  | 
nextcloud-whiteboard-server_1  | Using default in-memory adapter
nextcloud-whiteboard-server_1  | Listening on port: 3002
nextcloud-whiteboard-server_1  | Server started successfully on port 3002
nextcloud-whiteboard-server_1  | Using existing JWT_SECRET_KEY from environment
nextcloud-whiteboard-server_1  | cachedTokenStorage StorageManager {
nextcloud-whiteboard-server_1  |   strategy: GeneralLRUStrategy {
nextcloud-whiteboard-server_1  |     cache: LRUCache {
nextcloud-whiteboard-server_1  |       ttl: 600000,
nextcloud-whiteboard-server_1  |       ttlResolution: 1,
nextcloud-whiteboard-server_1  |       ttlAutopurge: true,
nextcloud-whiteboard-server_1  |       updateAgeOnGet: false,
nextcloud-whiteboard-server_1  |       updateAgeOnHas: false,
nextcloud-whiteboard-server_1  |       allowStale: false,
nextcloud-whiteboard-server_1  |       noDisposeOnSet: false,
nextcloud-whiteboard-server_1  |       noUpdateTTL: false,
nextcloud-whiteboard-server_1  |       maxEntrySize: 0,
nextcloud-whiteboard-server_1  |       sizeCalculation: undefined,
nextcloud-whiteboard-server_1  |       noDeleteOnFetchRejection: false,
nextcloud-whiteboard-server_1  |       noDeleteOnStaleGet: false,
nextcloud-whiteboard-server_1  |       allowStaleOnFetchAbort: false,
nextcloud-whiteboard-server_1  |       allowStaleOnFetchRejection: false,
nextcloud-whiteboard-server_1  |       ignoreFetchAbort: false,
nextcloud-whiteboard-server_1  |       getRemainingTTL: [Function (anonymous)],
nextcloud-whiteboard-server_1  |       [Symbol(Symbol.toStringTag)]: 'LRUCache'
nextcloud-whiteboard-server_1  |     }
nextcloud-whiteboard-server_1  |   }
nextcloud-whiteboard-server_1  | }
nextcloud-whiteboard-server_1  | Using existing JWT_SECRET_KEY from environment
nextcloud-whiteboard-server_1  | [57] Ton Machielsen has joined 57
nextcloud-whiteboard-server_1  | [57] Starting sync: { hasInputData: false, hasToken: true }
nextcloud-whiteboard-server_1  | [57] Determining data to update: { hasInputData: false, hasCurrentData: false, hasToken: true }
nextcloud-whiteboard-server_1  | [57] Fetching server data: {}
nextcloud-whiteboard-server_1  | FetchError: request to http://nextcloud/index.php/apps/whiteboard/57 failed, reason: connect ECONNREFUSED 127.0.1.1:80
nextcloud-whiteboard-server_1  |     at ClientRequest.<anonymous> (file:///app/node_modules/node-fetch/src/index.js:108:11)
nextcloud-whiteboard-server_1  |     at ClientRequest.emit (node:events:507:28)
nextcloud-whiteboard-server_1  |     at emitErrorEvent (node:_http_client:104:11)
nextcloud-whiteboard-server_1  |     at Socket.socketErrorListener (node:_http_client:518:5)
nextcloud-whiteboard-server_1  |     at Socket.emit (node:events:507:28)
nextcloud-whiteboard-server_1  |     at emitErrorNT (node:internal/streams/destroy:170:8)
nextcloud-whiteboard-server_1  |     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
nextcloud-whiteboard-server_1  |     at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
nextcloud-whiteboard-server_1  |   type: 'system',
nextcloud-whiteboard-server_1  |   errno: 'ECONNREFUSED',
nextcloud-whiteboard-server_1  |   code: 'ECONNREFUSED',
nextcloud-whiteboard-server_1  |   erroredSysCall: 'connect'
nextcloud-whiteboard-server_1  | }
nextcloud-whiteboard-server_1  | [57] Server data is invalid, recovering from backup: {}
nextcloud-whiteboard-server_1  | [57] Recovered from backup: {}
nextcloud-whiteboard-server_1  | [57] Room updated: { elementsCount: 0, filesCount: 0 }
nextcloud-whiteboard-server_1  | [57] Backup created: { elementsCount: 0, filesCount: 0 }

@grnd-alt
Copy link
Member

Hello, these errors indicate that your whiteboard server can't reach your nextcloud server. As those are two seperate services it is required that from the whiteboard server's environment the nextcloud instance is reachable. You can test this by running "wget <nextcloud_url>" and check if the correct responses are returned. The test in admin settings "only" checks if your nextcloud instance can reach the whiteboard server and has the correct secret, not vice versa.

@ToontjeM
Copy link
Author

ToontjeM commented Feb 12, 2025

√ ~ wget http://nextcloud
--2025-02-12 12:12:50--  http://nextcloud/
Resolving nextcloud (nextcloud)... 192.168.0.200
Connecting to nextcloud (nextcloud)|192.168.0.200|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://nextcloud/index.php/login [following]
--2025-02-12 12:12:50--  http://nextcloud/index.php/login
Reusing existing connection to nextcloud:80.
HTTP request sent, awaiting response... 200 OK
Length: 25552 (25K) [text/html]
Saving to: ‘index.html’

index.html                                                 100%[=====================================================================================================================================>]  24.95K  --.-KB/s    in 0.006s  

2025-02-12 12:12:50 (4.02 MB/s) - ‘index.html’ saved [25552/25552]

and

/app $ wget http://nextcloud
Connecting to nextcloud (127.0.1.1:80)
wget: can't connect to remote host (127.0.1.1): Connection refused
/app $ wget http://192.168.0.200
Connecting to 192.168.0.200 (192.168.0.200:80)
wget: server returned error: HTTP/1.1 400 Bad Request
/app $ 

So apparently inside the container nextcloud resolves to 127.0.1.1 where outside of the container it resolved to the correct IP address.

@ToontjeM
Copy link
Author

ToontjeM commented Feb 12, 2025

Ok, i resolved it by adding the nextcloud host IP address to the trusted_domains and setting NEXTCLOUD_URL to http://<IP address of nextcloud host>.

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