{"record":{"id":"5487341985c21a81","repo":"RocketChat/Rocket.Chat","slug":"file-upload-is-unauthorized-to-connect-on-webdav","errorCode":null,"errorMessage":"File upload is unauthorized to connect on Webdav, please verify your credentials","messagePattern":"File upload is unauthorized to connect on Webdav, please verify your credentials","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/media/file-upload/ufs/Webdav/server.ts","lineNumber":43,"sourceCode":"\tprotected getPath: (file: Omit<IUpload, '_updatedAt'>) => string;\n\n\tconstructor(options: WebdavOptions) {\n\t\tsuper(options);\n\t\tconst { server, username, password } = options.connection.credentials;\n\t\tconst client = new WebdavClientAdapter(server, { username, password });\n\n\t\toptions.getPath = function (file) {\n\t\t\tif (options.uploadFolderPath[options.uploadFolderPath.length - 1] !== '/') {\n\t\t\t\toptions.uploadFolderPath += '/';\n\t\t\t}\n\t\t\treturn options.uploadFolderPath + file._id;\n\t\t};\n\n\t\tclient.stat(options.uploadFolderPath).catch((err) => {\n\t\t\tif (err.message.toLowerCase() === 'not found') {\n\t\t\t\tvoid client.createDirectory(options.uploadFolderPath);\n\t\t\t} else if (err.message.toLowerCase() === 'unauthorized') {\n\t\t\t\tconsole.warn('File upload is unauthorized to connect on Webdav, please verify your credentials');\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * Returns the file path\n\t\t * @param file\n\t\t * @return {string}\n\t\t */\n\t\tthis.getPath = function (file) {\n\t\t\tif (file.Webdav) {\n\t\t\t\treturn file.Webdav.path;\n\t\t\t}\n\n\t\t\treturn file._id;\n\t\t};\n\n\t\t/**\n\t\t * Creates the file in the col lection","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/file-upload/ufs/Webdav/server.ts#L25-L61","documentation":"When the Webdav file-upload storage is configured, the server stats the configured upload folder to create it if missing; the Webdav server answered 'unauthorized'. This is a configuration-time check: credentials (or the server URL) in the File Upload -> Webdav settings are wrong, and until they are fixed every upload stored on Webdav will fail even though the server itself keeps running.","triggerScenarios":"Wrong username/password in the Webdav storage settings; password rotated/expired on Nextcloud/AD/IIS; URL pointing to the wrong path or scheme so the server responds 401; digest-auth-only servers unsupported by the client.","commonSituations":"Nextcloud/ownCloud or Windows IIS Webdav with password rotation policies; typos in host/path; forgotten scheme (http vs https) redirecting to an auth page.","solutions":["Re-enter and save the Webdav credentials in Administration -> File Upload -> Webdav WebDAV storage settings","Verify the same credentials and URL from the server with curl -u user:pass -X PROPFIND <url>","Confirm scheme, host, port and upload folder path match what the Webdav server expects","Save settings again afterwards and confirm the warn no longer appears in the logs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify Webdav access before enabling the storage\ntry {\n\tawait client.stat(uploadFolderPath);\n\t// authorized — safe to enable\n} catch (err: any) {\n\tif (String(err.message).toLowerCase() === 'unauthorized') throw new Error('Webdav credentials rejected — fix before enabling');\n\tthrow err;\n}","typeGuard":null,"tryCatchPattern":"client.stat(options.uploadFolderPath).catch((err) => {\n\tconst message = String(err.message).toLowerCase();\n\tif (message === 'not found') void client.createDirectory(options.uploadFolderPath);\n\telse if (message === 'unauthorized') console.warn('File upload is unauthorized to connect on Webdav, please verify your credentials');\n\telse throw err;\n});","preventionTips":["Test credentials from the server with curl -u before saving them in settings","Rotate Webdav passwords together with the Rocket.Chat setting, not independently","After saving, check the logs for this warn as a configuration smoke test"],"tags":["webdav","file-upload","storage","credentials","auth"],"backgroundTag":"webdav-auth-failed","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}