RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.09k stars 10.35k forks source link

Rocketchat and Nextcloud integration with WebDAV problem #19802

Closed sepahrad closed 2 years ago

sepahrad commented 3 years ago

Description:

I got Nextcloud with WEBDAV enabled. I can access and work with it by curl command.

I tried to add WebDAV Server from Rocket Chat but it shows --> Could not access WebDAV alert on top right of browser window.

In View Log section at Admin Panel we have error: Exception while invoking method addWebdavAccount Error: [object Object] [could-not-access-webdav]

Steps to reproduce:

  1. Go to '+'
  2. Click on 'Add Server'
  3. Add new WebDAV Account: URL + Username + Password

Expected behavior:

Connecting and working with webdav properly

Actual behavior:

Error!

Server Setup Information:

Client Setup Information

Relevant logs:

Exception while invoking method addWebdavAccount Error: [object Object] [could-not-access-webdav] at app/webdav/server/methods/addWebdavAccount.js:58:10 at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 => awaited here: at Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12) at Server.apply (packages/ddp-server/livedata_server.js:1638:22) at Server.call (packages/ddp-server/livedata_server.js:1607:17) at Object.post (app/api/server/v1/misc.js:262:26) at app/api/server/api.js:394:82 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Object._internalRouteActionHandler [as action] (app/api/server/api.js:394:39) at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32) at packages/nimble_restivus/lib/route.coffee:59:33 at packages/simple_json-routes.js:98:9

dougfabris commented 2 years ago

@sepahrad Thanks for reporting the issue. Do you still have the problem? If yes, could you please, verify your webdav provider url and your auth data?

idominiki commented 2 years ago

Hello @dougfabris,

we also have the problem. We got the error "Error accessing webdav". The URL is correct. It also seems not to be a DNS problem  1) the WebDAV can also not be reached via IP. 2) even with an IP technically accessible name server in the /etc/resolv.conf, name resolution does not work in the Rocketchat container.

I was also able to reach the Test WebDAV address in the container with (reinstalled) curl, but I still couldn't add it to a Rocketchat channel.

Do you need more informations?

Thanks and Greets Dominik

dougfabris commented 2 years ago

@idominiki can you provide which version you're running? I made some changes and it was introduced in version 4.3.0

idominiki commented 2 years ago

Hey @dougfabris

As we're running Rocket.Chat on Univention Corporate Server, the currently installed version is 3.18.2.

dougfabris commented 2 years ago

@idominiki Hmm. I believe the update to 4.3.0 should solve this issue! If you still get this error, let me know.

idominiki commented 2 years ago

Hi @dougfabris

Do you know when the 4.3.0 release is available in UCS App Center?

dougfabris commented 2 years ago

@idominiki Sorry, but I don't know. Maybe you can ask through the contact email available in UCS Rocket.Chat App Page?

LittleITworld commented 2 years ago

Hello I have the same problem with latest rocketchat version 4.5. My NC webdav is working fine (I can add it to my explorer)

dougfabris commented 2 years ago

@LittleITworld Can you provide screenshots and some web console logs?

LittleITworld commented 2 years ago

@LittleITworld Can you provide screenshots and some web console logs?

sure, here you go:

log: {"level":35,"time":"2022-04-06T12:28:03.094Z","pid":1406657,"hostname":"sw-chat","name":"Meteor","method":"addWebdavAccount","userId":"aqwkcSi26cEnokYn7","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Rocket.Chat/3.7.7 Chrome/96.0.4664.110 Electron/16.0.8 Safari/537.36","referer":"https://chat.hla-flensburg.de/direct/Q26QE2eb7JCqrnPgraqwkcSi26cEnokYn7","remoteIP":"172.17.1.69","instanceId":"bDmjXFb28z3RMm8gB"} {"level":50,"time":"2022-04-06T12:28:03.133Z","pid":1406657,"hostname":"sw-chat","name":"System","msg":"Exception while invoking method addWebdavAccount 'Could not access webdav [could-not-access-webdav]'"} I20220406-14:28:03.137(2) Exception while invoking method addWebdavAccount errorClass [Error]: Could not access webdav [could-not-access-webdav] at app/webdav/server/methods/addWebdavAccount.ts:65:10 at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 => awaited here: at Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12) at Server.apply (packages/ddp-server/livedata_server.js:1752:22) at Server.call (packages/ddp-server/livedata_server.js:1721:17) at Object.post (app/api/server/v1/misc.js:456:26) at app/api/server/api.js:425:96 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12) at Object._internalRouteActionHandler [as action] (app/api/server/api.js:425:39) at Route._callEndpoint (packages/rocketchat_restivus/lib/route.coffee:150:32) at packages/rocketchat_restivus/lib/route.coffee:59:33 at packages/simple_json-routes.js:100:9 { isClientSafe: true, error: 'could-not-access-webdav', reason: 'Could not access webdav', details: { method: 'addWebdavAccount' }, errorType: 'Meteor.Error' } {"level":35,"time":"2022-04-06T12:28:03.137Z","pid":1406657,"hostname":"sw-chat","name":"API","method":"POST","url":"/api/v1/method.call/addWebdavAccount","userId":"aqwkcSi26cEnokYn7","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Rocket.Chat/3.7.7 Chrome/96.0.4664.110 Electron/16.0.8 Safari/537.36","length":"250","host":"chat.hla-flensburg.de","referer":"https://chat.hla-flensburg.de/direct/Q26QE2eb7JCqrnPgraqwkcSi26cEnokYn7","remoteIP":"172.17.1.69","status":200,"responseTime":44}

Screenshots: config&error.zip

dougfabris commented 2 years ago

@LittleITworld I'm thinking about the issue is related to your WebDAV account security. Could you try to add some nextcloud demo account and see if it's work?