ISP3+Nginx+php7 Nextcloud Upload error

Discussion in 'General' started by Sion.Savior, Oct 8, 2017.

  1. Sion.Savior

    Sion.Savior New Member

    Hello Dear Community,
    I have a dedicated server running Nextcloud 12.0.3 on it. It also works in and of itself.
    I’m just having some minor technical difficulties.

    So the server is a:
    What works. I can use the “Sync your data” apps for desktop and Android to store and delete files on the cloud. Absolutely no problem.

    Which doesn’t work. When I try to save files via the browser, it doesn’t work. It is said (something like this, at least):
    You want to save a 1.5 MB file but there is not enough free space available. 0Bytes

    I don’t get any error messages in the log files everything seems to work smoothly.
    The only thing I get in the Acces. log is this when I upload a 0-byte file:

    xxx. xxx. xxx. xxx. xxx - - - -[07/Oct/2017:19:51:13 +0200]"GET /core/preview. png? file=%2F%2FNew+textdocument+ (3. txt&x=96&y=96&c=cec4c966d8800212d3719faacfb773c2&forceIcon
    xxx. xxx. xxx. xxx. xxx - - - -[07/Oct/2017:19:51:16 +0200]“PUT /remote. php/webdav/New%20Textdocument%20 (3). txt HTTP/1.1” 204 0 “-”"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like
    xx.xx.xx.xx - - -[07/Oct/2017:19:51:16 +0200]“PROPFIND /remote. php/webdav/New%20Textdocument%20 (3. txt HTTP/1.1” 207 902 “-”"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like G
    xxx. xxx. xxx. xxx. xxx - - - -[07/Oct/2017:19:51:20 +0200]“GET /ocs/v2. php/apps/notifications/api/v2/notifications HTTP/1.1” 200 1484 “-”"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like G
    When I upload a 1.6MB file I only get the message “there is no storage space”. There are no entries in the logs.

    However, Nextcloud tells me in the log that:
    Zend OPcache can’t be temporary enabled (it may be only disabled to the end of request) at Unknown#0
    GuzzleHttp\Exception\ExceptionRequestException: cURL error 18: transfer closed with 26500 bytes remaining to read
    But what I find amazing is that I can upload a 0Byte file without any problems.

    I also noticed that I can’t install apps automatically through the web interface. I guess it’s also because of this problem.

    Here’s my VHost for Nginx:

    Before I forget to mention it. the same configuration works with Apache.

    Could it be due to the CHMOD settings?
    I mean, ISPConfig creates users and groups, for example:
    Group: client1
    Owner: web1
    Is it because of the permissions that php7-fpm cannot access it?
  2. ISPConfig Developer ISPConfig Developer

    permissions should be fine, php-fpm will be configured to run as the uid/gid according to it's web.
    I don't know why it's complaining about zend opcache but did you try to disable it entirely for testing purpose?
    Could be a opcode cache issue/configuration issue.
    Would be nice if you could recheck with higher debug loglevels set.
  3. Sion.Savior

    Sion.Savior New Member

    Because the forum tells me that my message is way too long I just hang it on it.
    Pastebin Version
    TXT version attached

    Attached Files:

  4. ISPConfig Developer ISPConfig Developer

    first thing, you should disable any deflate/gzip/compression when using ssl.
    not finished yet though but one more question:
    did you try this with zend opcache disabled? meanwhile you could try what happens when gzip is off, however that's not necessarily the issue but it's another issue regarding
    • Reflect user-input in HTTP response bodies
    • Reflect a secret (such as a CSRF token) in HTTP response bodies
    • visitor uses "older" browser
    could lead to broken crypto => breach ; just want to make sure you don't have any issue there
  5. Sion.Savior

    Sion.Savior New Member

    of course, I had already done that.
    I've had different VHost files etc created. Gzip deactivated etc.
    But here's the actual vhost I'm using right now:
    By the way.. i tried already to deactivate ipv6 XD
    Here you can see that no more SSL is used. OPCache is also disabled

    opcache. enable=0
    opcache. enable_cli=0

    but without these extra lines it would be already deactivated with the default php. ini.

    I'm not trying to save the vhost or anything else at the moment. I just want to make sure that the next cloud with nginx is running properly.

    The clients work, yes, that's not the issue at hand. But working with clients is not the solution.
    Since the clients are accessing and uploading php7.0-cgi, etc. and the website is accessed via php7.0-fpm, I think it's probably because of that.

    I also noticed that this error is not server-bound. I have a 2 server and used the same configuration for testing. Same result. It must therefore be due to a configuration. If I install Apache NX works without problems. However, that is not the point. I don't want the Apache2 to run but NGINX.

    An alternative is that I might install PHP5 again... but this is not a long term solution. And even then it is questionable if php5-fpm works.
  6. Nemis

    Nemis Member

    have u found a fix?
  7. Sion.Savior

    Sion.Savior New Member

    No i havent found a fix.
  8. Ark74

    Ark74 Member

    For those having that issue, check the vhost file, seems ISPConfig adds a location with try_file random string,
    Comment that out, something like this,
    #        location ~ \.php$ {
    #            try_files /924dcf743d397dae1fe1e18d660d6141.htm @php;
    #        }
    reload/restart nginx and that will solve you "space" issues.
    ahrasis likes this.
  9. erikcas

    erikcas New Member

    It works for me, but:
    To do that properly and make that persistent, one should add to the nginx options in ispconfig:
    location ~ \.php$ { ##delete##
    } / @till or any other ispconfig guru, will that not lead to unwanted behaviour?

    Note: to prevent errors concerning permissions with uploading from phone (android) with this in error logs:
    2020/10/02 09:15:55 [error] 558260#558260: *1703 access forbidden by rule, client: x.x.x.x, server: cloud.x.y, request: "MOVE /remote.php/dav/uploads/<user>/2cfbb2cecaa629209d7d6a54145ed236/.file HTTP/1.1", host: "cloud.x.y"
    add this to the nginx options:

    location ~ /\. { ##delete##
    location ~ /\.(?!well-known)(?!file) {
          deny all;
    taken from this thread.
    Hope it helps, it might be worth writing a turorial for this.
    ahrasis likes this.

Share This Page