Nextcloud version (eg, 10.0.2) :
Operating system and version (eg, Ubuntu 16.04) :
Apache or nginx version (eg, Apache 2.4.25) :
PHP version (eg, 5.6) :
Is this the first time you’ve seen this error and can you replicate it?:
The issue you are facing:
I am getting the entry in my nextcloud.log
{“reqId”:“z+9KYnHVFdukh1zkxgi0”,“remoteAddr”:“xxxxxxxxx”,“app”:“no app in context”,“message”:“Temporary directory /var/www/nextcloud/data/upload-tmp is not present or writable”,“level”:2,“time”:"2017-01-22T06:19:39+00$
{“reqId”:“59ZZShDRrRI7UkdVsdTK”,“remoteAddr”:“xxxxxxxxx”,“app”:“no app in context”,“message”:“Temporary directory /var/www/nextcloud/data/upload-tmp is not present or writable”,“level”:2,“time”:"2017-01-22T06:20:06+00$
{“reqId”:“C8Ak5nAystse1nRws12t”,“remoteAddr”:“xxxxxxxx”,“app”:“no app in context”,“message”:“Temporary directory /var/www/nextcloud/data/upload-tmp is not present or writable”,“level”:2,“time”:"2017-01-22T06:20:10+00$
when I look in the directory I do not have an upload-tmp dir
do I simply just make one and it all works fine or are there specific permissions that I would need to set for this dir upload-tmo dir as well?
EDIT
so I ran mkdir upload-tmp and it made this
drwxr-xr-x 2 root root 4096 Jan 22 00:30 upload-tmp
I am still getting the error in the log CONSTANTLY.
I am not sure if the permissions or the ownership is wrong or right
I also do not have a tmp location in the config.php if that matters
apply the permissions to your webuser (e.g. “www-data”) by running
chown -R www-data:www-data /var/www/nextcloud/data
and in addition check your php settings.
vi /etc/php/7.0/fpm/php.ini
vi /etc/php/7.0/cli/php.ini
Please adjust the upload_tmp_dir to e.g. your directory:
upload_tmp_dir = /var/www/nextcloud/data/upload_tmp
I have the same error. Directory exist, is set successfully in apache2 + cli php.ini
and permissions are:
drwxr-xr-x 2 www-data www-data 4096 Aug 20 01:30 php_upload_tmp
PHP settings are working well also, as seen by phpinfo()
:
Directive Local Value Master Value
...
upload_tmp_dir /var/tmp/php_upload_tmp /var/tmp/php_upload_tmp
€: Tested also chmod 777, but same result. Does the /tmp folder also need specific permissions?
€€: Also changing /tmp permissions from 1755 to 1777 does not solve it.
Do you have ‘open_base_dir’ configured in php? If so, was this temp-dir added properly as well?
Sorry for the late reply. Didn’t get any notification about your reply .
open_basedir
is not set in any PHP configuration.
opened 10:57PM - 07 Feb 16 UTC
closed 09:00AM - 09 Feb 16 UTC
### Steps to reproduce
1. Setup upload_tmp_dir in php.ini:
```
# grep upload_tm… p_dir /etc/php/fpm-php7.0/php.ini
;upload_tmp_dir =
upload_tmp_dir = /var/tmp/php
```
1. Ensure that the directory exists and is accessible by PHP-FPM:
```
# ls -la /var/tmp/php/
total 8
drwxr-x---. 2 lighttpd lighttpd 4096 Jan 3 13:59 .
drwxrwxrwt. 11 root root 4096 Feb 7 22:19 ..
# ps aux | grep php-fpm
root 8240 0.0 1.1 274312 23816 ? Ss 22:19 0:00 php-fpm: master process (/etc/php/fpm-php7.0/php-fpm.conf)
lighttpd 8241 0.1 1.6 382684 34304 ? S 22:19 0:00 php-fpm: pool www
lighttpd 8242 0.0 1.7 382708 36300 ? S 22:19 0:00 php-fpm: pool www
lighttpd 8246 0.0 1.5 380660 31608 ? S 22:22 0:00 php-fpm: pool www
```
1. Access ownCloud through webbrowser
2. Observe lots of messages in owncloud.log:
```
"app":"no app in context","message":"Temporary directory \/var\/tmp\/php is not present or writable","level":2
```
### Expected behaviour
ownCloud should be able to access the directory, or output more helpful debugging information (e.g. own (e)uid/gid, observed file mode and owner/group).
### Actual behaviour
Looking at the process uid/gid and the directory owner/group and mode, PHP-FPM and thus ownCloud should be able to access the directory, but for whatever reason it claims it can't, without providing any helpful debugging information.
### Server configuration
**Operating system**: Gentoo/Linux, Kernel 4.1.7-hardened-r1
**Web server:** Lighttpd 1.4.35
**Database:** MariaDB 10.0.23
**PHP version:** 7.0.3
**ownCloud version:** 8.2.2
**Updated from an older ownCloud or fresh install:** Updated
**Signing status (ownCloud 9.0 and above):** N/A
```
Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
```
Redirects to `index.php/apps/files/`
**List of activated apps:**
```
# su -s /bin/bash -c "php7.0 $PWD/occ app:list" - lighttpd
Enabled:
- activity: 2.1.3
- bookmarks: 0.6
- calendar: 0.8.1
- contacts: 0.5.0.0
- documents: 0.11.0
- files: 1.2.0
- files_pdfviewer: 0.7
- files_sharing: 0.7.0
- files_texteditor: 2.0
- files_trashbin: 0.7.0
- files_versions: 1.1.0
- files_videoviewer: 0.1.3
- firstrunwizard: 1.1
- galleryplus: 14.3.0
- music: 0.3.8
- notifications: 0.1.0
- search_lucene: 0.6.0
- tasks: 0.8.1
- updater: 0.6
- user_ldap: 0.7.1
Disabled:
- encryption
- external
- files_antivirus
- files_external
- gallery
- provisioning_api
- templateeditor
- user_external
```
**The content of config/config.php:**
```
# su -s /bin/bash -c "php7.0 $PWD/occ config:list system" - lighttpd
{
"system": {
"trusted_domains": [
"REDACTED"
],
"datadirectory": "\/var\/lib\/owncloud",
"dbtype": "mysql",
"version": "8.2.2.2",
"dbname": "owncloud",
"dbhost": "REDACTED",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"ldapIgnoreNamingRules": false,
"forcessl": true,
"theme": "",
"maintenance": false,
"mail_smtpmode": "smtp",
"mail_smtpsecure": "tls",
"mail_smtphost": "REDACTED",
"mail_smtpport": "587",
"mail_domain": "REDACTED",
"mail_from_address": "noreply",
"loglevel": 2,
"forceSSLforSubdomains": true,
"instanceid": "REDACTED",
"secret": "***REMOVED SENSITIVE VALUE***",
"trashbin_retention_obligation": "auto",
"memcache.local": "\\OC\\Memcache\\APCu"
}
}
```
**Are you using external storage, if yes which one:** no
**Are you using encryption:** no
**Are you using an external user-backend, if yes which one:** LDAP
#### LDAP configuration (delete this part if not used)
```
# su -s /bin/bash -c "php7.0 $PWD/occ ldap:show-config" - lighttpd
+-------------------------------+---------------------------------------------+
| Configuration | |
+-------------------------------+---------------------------------------------+
| hasMemberOfFilterSupport | |
| hasPagedResultSupport | |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | REDACTED |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | REDACTED |
| ldapBaseGroups | REDACTED |
| ldapBaseUsers | REDACTED |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapEmailAttribute | |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=posixGroup))) |
| ldapGroupFilterGroups | |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | posixGroup |
| ldapGroupMemberAssocAttr | memberUid |
| ldapHost | REDACTED |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(|(objectclass=posixAccount))(uid=%uid)) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | 0 |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserDisplayName | cn |
| ldapUserFilter | (|(objectclass=posixAccount)) |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | posixAccount |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+---------------------------------------------+
```
### Client configuration
**Browser:** Firefox 44
**Operating system:** Gentoo/Linux
### Logs
#### Web server error log
```
<empty regarding ownCloud>
```
#### ownCloud log (data/owncloud.log)
```
The only current part was pasted above
```
#### Browser log
```
...
```
Seems to show the reason:
I figured out that the php-fpm was not seeing the same contents of /var/tmp, because of the systemd.service file utilising PrivateTmp=true
But I do not find systemd.service
on my system and couldn’t find out so far how so unset PrivateTmp=true
. Is there another way to enable PHP to see files there?