Owncloud hosted on our server suddenly started showing this error after we made some system changes recently. This issue has been brought up a few times before in the forums, but those discussions appeared to have not resulted in a resolution or identification of a working solution. Anyone who went through the same issue and if you were able to identify a solution, please share. Thanks.
" Your Data directory is invalid. Please check that the data directory contains a file ".ocdata" in its root.
Your Data directory is not writable by ownCloud
Permissions can usually be fixed by <a href="https://doc.owncloud.org/server/10.4/go.php?to=admin-dir_permissions" target="_blank" rel="noreferrer">giving the webserver write access to the root directory</a>."
Have you tried reverting your system changes and seeing whether that fixes the issue?
Please paste the file permissions for your data directory. ls -alZ
There is a template for server topics, not sure why you neglected to use it, but in order to help you effectively we need the information you would have provided by filling it out.
@enebauer:
Thanks for your reply. We followed the said procedure mentioned by OwnCloud and also in alignment with our overall system. We just upgraded the OS and migrated the same framework to a faster drive partition in the same system. Otherwise, everything was done as per suggested installation method and was fully functional before.
Note: As a follow up to this message, I also shared the following with a couple of mentioned individuals at owncloud further elaborating the issue by email, which touched upon what you had asked in this message
Let me start with the file permissions within the data folder:
root@lamp-1-dns-1:################ ls -alZ
total 4
drwxrwxâ 1 root root ? 32 Aug 5 22:12 .
drwxr-xr-x 1 web15 client2 ? 516 Aug 5 22:38 âŚ
-rw-râr-- 1 root www-data ? 542 Aug 5 21:55 .htaccess
-rw-râr-- 1 root root ? 0 Aug 5 22:12 .ocdata
Please note that I also ran the bash script given on the Owncloud site to optimize the permissions list, which was also captured in my email.
Email sent to the OwnCloud support team after posting this message:
Hello OwnCloud Team:
This message is with regard to a couple of errors that I am seeing on the Owncloud landing page. We have had this installation for some time and started seeing this error after our recent upgrade in OS, and migration to a new drive.
We also tried to address the issue by confirming the presence of .ocdata and also ran a bash script to add right permissions aligning with the two error messages. Even after making these changes, we donât see the error getting fixed. I also tried to share the same issue over through the Owncloud forum, and have not received any response over there.
Changing permissions: (Output from Bash script)
root@lamp-1-dns-1:####### ./perm.sh
Do you want to secure your .htaccess files post installing/upgrade (y/N)? y
Securing .htaccess files with chmod/chown
Bash script Reference:
/installation/installation_wizard.html#data-directory-location on the OwnCloud site
I would also like to add that Nextcloud, which is similar to Owncloud is fully functional on our server after the switch.
If you happen to have any suggestions in this regard, please let me know.
@enebauer: When it comes to template, not sure what you meant by that. Please share the link and I will follow that template for server topics in the future.
i think as well that the permissions are wrong because other users then ârootâ or users within the ârootâ group are not allowed to access the data dir because of the current permissions.
i think it is not directly related to your issue but still want to ask this:
Is ownCloud located at the same filesystem path?
If not additional problems could be originating from a changed path because ownCloud needs special modifications if the data directory was moved:
@alfredb & @anon21401411: thanks.
It was the default permissions for the data directory. This permission also aligns with what I have for Nextcloud, which runs on the same server and tld. That one is fully functional.
So, what I did was the following, which helped to address the previous issues, but has led to a new issue, namely a blank white screen.
Steps taken:
First, renamed the old data directory to backup and created a new data directory and a new .ocdata file. Creating these two addressed the .ocdata issue, but not the second one.
So, I followed the instructions from a connected link that tom42 shared and ran a bash script, which led to a blank screen. If there is a blank php screen, this usually pertains to permissions, specifically for the config based on handling other php files in the past. However, I am unable to still locate the primary cause for this issue. Any thoughts on this one.
Permission bash script that was run:
#!/bin/bash
Sets permissions of the owncloud instance for updating
before running any scripts randomly i think you need to first find out as which user the ownCloud installation is running. e.g. a previously post of you is mentioning âweb15â as a user and âclient2â as a group, if thatâs the user and group but youâre changing the permissions to âwww-dataâ then i think it is obviously that things will break
thanks, tom42. It was not done randomly, but it was done based on the manual.
web15 is mapped to the domain, our.comedaddymummy.com through the configuration panel. So, those are one and the same. our.comedaddymummy.com -> /var/www/clients/client2/web15/
The ocpath given points to this domain folder where the data folder is present.
Taking your suggestion, I changed the ocpath to the one on the right to see whether that makes a difference, and that did not help, which should be the case. I also verified the permissions with what I have for the Nextcloud folder, and those match too.
Sorry, i picked the wrong wording for ârandomlyâ (not a native English speaker). I thought you just ran the script without checking first if the âhtuserâ and âhtgroupâ were correct
Glad that setting the correct permissions solved your issue now