RocketChat/Rocket.Chat · warning
File upload is unauthorized to connect on Webdav, please ver
Error message
File upload is unauthorized to connect on Webdav, please verify your credentials
What it means
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.
Source
Thrown at apps/meteor/server/lib/media/file-upload/ufs/Webdav/server.ts:43
protected getPath: (file: Omit<IUpload, '_updatedAt'>) => string;
constructor(options: WebdavOptions) {
super(options);
const { server, username, password } = options.connection.credentials;
const client = new WebdavClientAdapter(server, { username, password });
options.getPath = function (file) {
if (options.uploadFolderPath[options.uploadFolderPath.length - 1] !== '/') {
options.uploadFolderPath += '/';
}
return options.uploadFolderPath + file._id;
};
client.stat(options.uploadFolderPath).catch((err) => {
if (err.message.toLowerCase() === 'not found') {
void client.createDirectory(options.uploadFolderPath);
} else if (err.message.toLowerCase() === 'unauthorized') {
console.warn('File upload is unauthorized to connect on Webdav, please verify your credentials');
}
});
/**
* Returns the file path
* @param file
* @return {string}
*/
this.getPath = function (file) {
if (file.Webdav) {
return file.Webdav.path;
}
return file._id;
};
/**
* Creates the file in the col lectionView on GitHub (pinned to b2c16d5842)
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
Defensive patterns
Strategy: validation
Validate before calling
// verify Webdav access before enabling the storage
try {
await client.stat(uploadFolderPath);
// authorized — safe to enable
} catch (err: any) {
if (String(err.message).toLowerCase() === 'unauthorized') throw new Error('Webdav credentials rejected — fix before enabling');
throw err;
} Try / catch
client.stat(options.uploadFolderPath).catch((err) => {
const message = String(err.message).toLowerCase();
if (message === 'not found') void client.createDirectory(options.uploadFolderPath);
else if (message === 'unauthorized') console.warn('File upload is unauthorized to connect on Webdav, please verify your credentials');
else throw err;
}); Prevention
- 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
When it happens
Trigger: 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.
Common situations: Nextcloud/ownCloud or Windows IIS Webdav with password rotation policies; typos in host/path; forgotten scheme (http vs https) redirecting to an auth page.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Error sending file to apps
- The environmental variable "${envVarName}" is not readable.
- File name is required
- response.message ? t(response.message) : 'Error uploading fi
- auth option should be of the form "username:password"
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/5487341985c21a81.
Report an issue: GitHub.