Hi,
I’m stuck ! I tried everything and still, I can not connect my n8n services to my Nextcloud. I tried both method and nothing is working. I get errors like these two depending on authentification method :
- OAuth :
{"code":0,"message":"Unable to connect to cloud.my-domainname.co:443","hint":""}
This error comes from the web browser (in the popup created to accept terms) at the end. So right after user accept terms the popup get redirect to https://sub.my-domain.co/rest/oauth2-credential/callback?state=<token_state>&code=<token_code> and it create this error. I do not see any error on Nextcloud. On n8n the log gave me this :
2022-08-19T01:50:12.044Z | verbose | Credential updated "{ credentialId: '5', file: 'credentials.api.js' }"
2022-08-19T01:50:12.209Z | verbose | OAuth2 authentication successful for new credential "{\n userId: '444-444-4d41-8f78-xxx444',\n credentialId: '5',\n file: 'oauth2Credential.api.js'\n}"
Even if it looks like it has been successfull in n8n… nothing works in the workflows. So something happen at the end of OAuth procedure that makes impossible to n8n to finish the transaction.
- Access token :
2022-08-19T01:46:40.842Z | debug | Credential test failed UNKNOWN ERROR - check the detailed error for more information
.... ....
httpCode: 'ECONNREFUSED',\n description: 'connect ECONNREFUSED 10.0.3.82:443'\n },\n timestamp: 1660873600842,\n node: {\n id: 'temp',\n parameters: { temp: '' },\n name: 'Temp-Node',\n type: 'n8n-nodes-base.noOp',\n typeVersion: 1,\n position: [ 0, 0 ],\n credentials: { nextCloudApi: [Object] }\n },\n httpCode: null,\n description: 'connect ECONNREFUSED 10.0.3.82:443',\n file: 'CredentialsHelper.js',\n function: 'testCredentials'\n}"
What I already tried
- I tested n8n from n8n.io and OAuth works perfectly with my Nextcloud. Error is created because both are in Docker swarm.
- In Nextcloud, I change config file to trusted_domain // trusted_proxies double checked and everything. Use also overwrite method has explain in documentation. Still not working.
Information on my n8n / nextcloud setup
- Both services are in docker swarm mode activated
- Both services are behind Traefik reverse proxy
- Configuration for Nextcloud has been follow just like this doc : doc
- Traefik, n8n, NC are in same network but not same host / node
- n8n version: 0.191.0
- Database you’re using default SQLite
Need help here, if anybody can share their tought it would be very much appreciated. I’m new to this community but really look foward to use n8n. Very promising ! Thanks