Unable to create new content or folders

Nextcloud version (eg, 13.0.2):
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version , Apache 2.4.29_:
PHP version 7.1:

The issue you are facing:

Unable to create new files or folders.

I have this text below indicating issues I need to address but none refers to above mentioned flaw.

It’s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Tricks section and the documentation for more information.

* /dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in the documentation.
* Accessing site insecurely via HTTP. You are strongly adviced to set up your server to require HTTPS instead, as described in the [security tips
.

_* No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the [documentation

* The PHP OPcache is not properly configured. [For better performance it is recommended](https://docs.nextcloud. com/server/13/go.php?to=admin-php-opcache) to use the following settings in the php.ini :

_ _opcache.enable=1_ _opcache.enable_cli=1_ _opcache.interned_strings_buffer=8_ _opcache.max_accelerated_files=10000_ _opcache.memory_consumption=128_ _opcache.save_comments=1_ _opcache.revalidate_freq=1_ _

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Log on
  2. See it
  3. Try to make content

The output of your Nextcloud log in Admin > Logging:

waay to much to paste here

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

Hav no config.php file in that location

The output of your Apache/nginx/system log in /var/log/____:

Not easily accessible

The setup is Vanilla, no alterations done.

Unable to create files or folders? The first thing to check is how the permissions are set. Let’s say you installed Nextcloud in /var/www/nextcloud, everything should be owned by your web user (I’ll assume you use Nextcloud 13 with Ubuntu 16.04 and Apache since you didn’t specify those). So in that case everything should be owned by www-data. Folders should all be set to 750 and files should all be set to 640. See step 9 in this guide: https://docs.nextcloud.com/server/13/admin_manual/maintenance/manual_upgrade.html?highlight=manual%20upgrade

Regarding your config.php file, you will want to find that as it’s important to make changes there. That would be located in /var/www/nextcloud/config/config.php (or wherever you put Nextcloud when you installed it).

If you still have trouble, let us know more about your setup such as the Linux version, which version of Nextcloud, are you using Apache/Nginx, did you install from a snap package, etc.

OK, checking.

  1. Its on a VPS with Centos 7.0 x64, PHP 7.1, Apache 2.4.29 (KVM Virtual)

  2. Folders are 755, files 644. That is a lot of changes I would have to do… any tips on that?

  3. The original template used on this forum to create a post had the wrong path specified for the config.php file. I now have it.

    <?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '185.189.51.24',
  ),
  'datadirectory' => '/home/public_html/intranet/data',
  'overwrite.cli.url' => 'https://intranet',
  'dbtype' => 'mysql',
  'version' => '13.0.2.1',
  'dbname' => '',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'updater.secret' => '',
  'theme' => '',
  'loglevel' => 2,
);
  1. I have installed it via the download package.

(had to edit this post several times, this forums really sucks in comparison with phpBB or vBulletin)

Ah… it did not work before the upgrade either… just saying… no other errors other that the tips about performance and that stuff posted in my first entry.

I would strongly recommended redacting your ip address (trusted domain, overwrite cli) and updater secret so all your private info isn’t exposed here.

  1. Great.
  2. Just run the three commands within the nextcloud installation path. That will recursively change ownership, set directory permissions, then set file permissions. Step 9 on the manual upgrade page lists the commands to recursively change the ownership and permissions.
  3. Yes they should probably add /config to that path.
  4. Good.

edited

  1. `chown -R www-data:www-data nextcloud
    find nextcloud/ -type d -exec chmod 750 {} ;
    find nextcloud/ -type f -exec chmod 640 {} ;´

I was actually looking up chown commands and i guess you are telling to run this from SSL/Bash

Well, I suppose I would have to change the find from nextcloud to the relevant path since nextcloud does not exist as folder

Correct, run this from the terminal assuming you have ssh access. And yes just change “nextcloud” to whatever your nextcloud path is for each of the three commands.

Woops:
after running above commands and verifying files and folders seem to have correct chmod…

Forbidden

You don’t have permission to access */index.php on this server.
Server unable to read htaccess file, denying access to be safe

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

why that? Server has been rebooted, the .htaccess is 640, also tried setting it to 644, still no go.

ok, managed to find a possible issue.
The folder with nextcloud in it was also chmodded 750, after changing it to 755 it seems to work agin, but right now I am unable to trigger the login script.

Maybe i should to the checks after step 9 in the manual linked above.

Hm. If changing from 750 to 755 fixed something, that indicates an ownership problem. What about running chown? Does your webhost allow you to change file ownership?
Another way would be to add the web user to the group set on the files

I can change pretty much anyting that may be reelvant for chown or chmod, but I have never encountered these kinda requirments for 640 and 750 before. Seems exclusive for Nextcloud.

Now, if I were to change back to 644 and 755 globally, what specific folders/files would I have to set to 640/750 after that?

The reason I ask this is because I think the server is having issues reading in layout, perhaps css, since that is what is lacking in the currentl login page, plus of course the login action as such triggered by an unclickable “login” button.

I have no problem sharing the URL since this is a test/wip site.
http://185.189.51.24/~eslovsmodx/intranet/index.php/login?

It’s not exclusive to Nextcloud, it’s actually a common permission set for websites. Here’s more information explaining permissions in Linux if you want a better understanding of why you might set them up a certain way. https://www.linux.com/learn/understanding-linux-file-permissions

Regarding layout files, there should be no write or execute permissions required, so even if you can’t sort out the ownership problem, having set all files to 644 and all directories to 755 gives read access to everyone. Having said that, if permissions are still causing the problem, it’s not in the layout.

Does your provider give another way to change ownership/permissions? Can you find out who the web user account is? Cpanel? In Ubuntu/Apache this would normally be www-data.

The reason you want to set the correct owner is to allow write access to the web user in order to do updates later on. If it only has write access, you will probably have difficulty installing updates.

Is this a custom theme? If so, can you try changing back to the stock theme (remove the theme entry in config.php) and see if things start working.

I have been using, editing and setting up web sites in at least a dozen different CMS systems (Joomla, Wordpress, Typo3, Drupal, E107, Gallery, PHP-Fusion, Piwigo, etc…) for the last 30 years and never came across the 640/750 combination as specified here. Just saying… not you regular noob here, if I may be so bold. :wink:
However I am a bit new to actually managing a VPS via SSH and all that stuff, and I am of course new to Nextcloud.

The owner of the files is the relevant account for that site, account and web server. (It my web server and my account, I am the owner). For all intents and purposes the www-data account. The Theme has not been customized, I only uploaded a custom image, but I will take a second look at that once I get in on the site. The config.php is the same as the one you have above in this thread. If you see no theme alteration in that file, there is none.

The provider uses DirectAdmin which is a interface like CPanel, but simpler. I dumped CPanel a long time a go, waaaay to complex for my needs. It has a file browser and that can be used to set permissions, but not very efficient for many files.

Sounds like you have far more experience than I do :slight_smile:

I don’t see any problem with the way you have permissions set, even leaving them at 755/644. If you really want to be sure, you could temporarily set everything to 777 just to see if you can log in. I have a feeling that won’t make any difference though.

Aside from permissions and assuming all files/directories are intact, I would start investigating the Apache configuration. But if you’re willing to, maybe just start fresh with Nextcloud just in case something got messed up with the files.

Even on a wip site i would not set anything at 777, thats down right asking for a hack.

Again, i will try resetting the permissions back, but the original question remains, what files need to be 750/640 for me to be able to create content?

The site is, as I said, pretty much vanilla although there are a few steps in the manual setup you linked to I can try, like 10-11 etc…

I will post again when thats done, tad busy these days.

Fair enough :slight_smile:
In order to create content, you need to make sure the data directory has the proper permissions (pointed to in your config file)

'datadirectory' => '/home/public_html/intranet/data',

Including that data directory which should be writable by Nextcloud. Nextcloud should own that directory and everything underneath it recursively.

I don’t know if that can have any effect on the login function, but I’m sure you’ll report back after you try it out.

had some unexpected issues resetting the default file permissions on server, but now that that is done, despite setting 774 and experimenting with 777 for a short period of time this is still not working.

It might not hurt to ask your VPS provider for some help. Maybe they know something we don’t.

They already know and has from day one. I will place the question again though.

It so happens they have Installatron with Owncloud and when I asked about Nextcloud they said it should be zero issues.

Maybe i should just test an offline installation on my home server, creating a virtual LAMP and go from there… hmm…

When these things happen I usually throw the software off a cliff and find something else, but I will try some more.