-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[Bug]: Fail to create new files because of Call to undefined method OC\\Files\\Node\\File::searchByMime() [Cause: user templateDirectory
pointed at a file]
#49436
Comments
What is the templateDirectory set to for your account? e.g.
And is it a folder within that account? e.g. ls data//files/ |
Hi, thank your for your response.
honestly I have no idea how it happened in the first place, given I wasn't even aware such a command exists. Setting it to empty solved the issue It would be really nice if nextcloud handled such error in a more user friendly way, so that the user knows from the ui when creating new files, that the template dir is incorrect or something (instead of doing nothing but raising this error in the logs) |
Glad to hear it!
Not sure how you ended up like that either. That value is set by default in new installations, based on the global defaults. It can also be customized globally by an admin override. When template support was added in v21, a sort of "stop gap" workflow was implemented for older environments and their existing accounts. Since existing environments and their existing accounts would have lacked a template directory, the user gets the option (via the New button in Files to establish a template directory. Once that is done, the web UI visibility of that setting goes away - the same setting I gave you the I've no idea how yours ended up pointed at a specific file rather than a
If the file/folder had not existed it would have re-triggered the Create new template folder workflow. I'm guessing the weird value in your case at least pointed to an existing |
templateDirectory
pointed at a file]
P.S. #46455 may re-expose the config parameter in the UI to the user which will also help with this. |
Bug description
Hello when trying to create a new file (ex text file / doc file ...) nothing happens and nextcloud throws the following error:
The server responds with a HTTP500 to ocs/v2.php/apps/files/api/v1/templates
Creating folder or files from other app (eg. drawio files) does work.
Steps to reproduce
Expected behavior
The desired file is created.
Nextcloud Server version
30
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 28 to 29)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
The error appeared with nextcloud 30 as far as I can remember. Updating to 30.0.1 and 30.0.2 didn't help.
The text was updated successfully, but these errors were encountered: