Read-only file system error

Hello, I have been using Nextcloud with my external USB drive.
Everything was quite well, but at some point something started blocking my USB drive, so I can’t create file or even I can’t do chown on any file or directory on the drive. Always the same error: ‘Read-only file system’. Actually, reboot helps but for a while. About 15-30 minutes after system stratup the drive is locked again. That’s really annoying to reboot every half an hour.
It looks like some nextcloud job is locking down the drive… Might be connected to update not long ago.
Data directory is writable for everyone (rwx rwx rwx)

The issue you are facing:
Is this the first time you’ve seen this error? No

Steps to replicate it:

  1. Use external USB drive
  2. Wait a while
  3. Try to copy/move or upload new file
ncp-report

<–! Paste this in GitHub report -->

NextCloudPi diagnostics

{"reqId":"kjQpdzZay71NeVVh5VSp","level":2,"time":"2019-05-29T15:43:05+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory \/media\/USBdrive\/ncdata\/tmp is not present or writable","userAgent":"--","version":"15.0.2.0"}
NextCloudPi version  v1.12.7
NextCloudPi image    NextCloudPi_01-14-19
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda
datadir              /media/USBdrive/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      16G/466G
rootfs usage         2.3G/7.3G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        closed
port check 443       closed
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               1:26

Nextcloud configuration

{"reqId":"tVvJN1PvbKWcGnb1Z6G7","level":2,"time":"2019-05-29T15:43:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory \/media\/USBdrive\/ncdata\/tmp is not present or writable","userAgent":"--","version":"15.0.2.0"}
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/15/go.php?to=admin-dir_permissions.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}
HTTPd logs

[Wed May 29 06:25:02.940123 2019] [ssl:warn] [pid 1173] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed May 29 06:25:02.940802 2019] [ssl:error] [pid 1173] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Wed May 29 06:25:02.940912 2019] [ssl:error] [pid 1173] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed May 29 06:25:02.941086 2019] [http2:warn] [pid 1173] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Wed May 29 06:25:04.001317 2019] [mpm_prefork:notice] [pid 1173] AH00163: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2r configured -- resuming normal operations
[Wed May 29 06:25:04.001441 2019] [core:notice] [pid 1173] AH00094: Command line: '/usr/sbin/apache2'
[Wed May 29 17:17:00.851633 2019] [mpm_prefork:notice] [pid 1173] AH00169: caught SIGTERM, shutting down
[Wed May 29 17:17:16.848253 2019] [ssl:warn] [pid 791] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed May 29 17:17:16.850624 2019] [ssl:error] [pid 791] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Wed May 29 17:17:16.850692 2019] [ssl:error] [pid 791] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed May 29 17:17:17.093057 2019] [ssl:warn] [pid 1115] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed May 29 17:17:17.093383 2019] [ssl:error] [pid 1115] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Wed May 29 17:17:17.093406 2019] [ssl:error] [pid 1115] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed May 29 17:17:17.093537 2019] [http2:warn] [pid 1115] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Wed May 29 17:17:19.014326 2019] [mpm_prefork:notice] [pid 1115] AH00163: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2r configured -- resuming normal operations
[Wed May 29 17:17:19.014519 2019] [core:notice] [pid 1115] AH00094: Command line: '/usr/sbin/apache2'
stat: cannot stat '/media/USBdrive/ncdata/appdata_ockhnd03zkvv/theming/0/icon-core-filetypes_audio.svg': No such file or directory

Database logs

2019-05-29 17:17:02 1969185600 [Note] /usr/sbin/mysqld: Shutdown complete

2019-05-29 17:17:37 1989087024 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-05-29 17:17:37 1989087024 [Note] InnoDB: The InnoDB memory heap is disabled
2019-05-29 17:17:37 1989087024 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-29 17:17:37 1989087024 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-05-29 17:17:37 1989087024 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-05-29 17:17:37 1989087024 [Note] InnoDB: Using Linux native AIO
2019-05-29 17:17:37 1989087024 [Note] InnoDB: Using generic crc32 instructions
2019-05-29 17:17:37 1989087024 [Note] InnoDB: Initializing buffer pool, size = 370.0M
2019-05-29 17:17:38 1989087024 [Note] InnoDB: Completed initialization of buffer pool
2019-05-29 17:17:38 1989087024 [Note] InnoDB: Highest supported file format is Barracuda.
2019-05-29 17:17:39 1989087024 [Note] InnoDB: 128 rollback segment(s) are active.
2019-05-29 17:17:39 1989087024 [Note] InnoDB: Waiting for purge to start
2019-05-29 17:17:39 1989087024 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.42-84.2 started; log sequence number 416250835
2019-05-29 17:17:39 1111487296 [Note] InnoDB: Dumping buffer pool(s) not yet started
2019-05-29 17:17:39 1989087024 [Note] Plugin 'FEEDBACK' is disabled.
2019-05-29 17:17:39 1989087024 [Note] Server socket created on IP: '127.0.0.1'.
2019-05-29 17:17:39 1989087024 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.38-MariaDB-0+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Raspbian 9.0

Nextcloud logs

{"reqId":"XObw8n8AAQEAAAbv8-oAAAAL","level":3,"time":"2019-05-23T19:13:55+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53505&c=87d1d1e57da90cf7c34ff40b69b7e188&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw8X8AAQEAAATlo4sAAAAD","level":3,"time":"2019-05-23T19:13:55+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53502&c=556fd343e6662580d3c3a1fda579d15c&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw8X8AAQEAAAbSxt4AAAAG","level":3,"time":"2019-05-23T19:13:55+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53501&c=0ae77a5e8bd4a917e48ccc071d34b889&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw8n8AAQEAAATgWEQAAAAC","level":3,"time":"2019-05-23T19:13:55+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53504&c=bdd5ee0ee92b3fb5f30307afc29cb51a&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw8X8AAQEAAAgW@WMAAAAJ","level":3,"time":"2019-05-23T19:13:55+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53500&c=2e856416eafc3cf67e360c3c94640883&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw8n8AAQEAAAag-ZYAAAAF","level":3,"time":"2019-05-23T19:13:55+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53503&c=7f7bf98bab437f43c0f98530c0a2d7c3&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw838AAQEAAAbSxt8AAAAG","level":3,"time":"2019-05-23T19:13:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53507&c=116dedea89c6b4a828efe09ac6d2abe0&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw838AAQEAAATgWEUAAAAC","level":3,"time":"2019-05-23T19:13:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53506&c=8b9da3dc88d00043398ef0bf5150543c&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw838AAQEAAAbv8-sAAAAL","level":3,"time":"2019-05-23T19:13:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53508&c=9a49d0740a9112abe060fe6a9e37123d&x=250&y=250&forceIcon=0","message":"fopen(\/media\/USBdrive\/ncdata\/ncp\/files\/Downloads\/Music\/Trance hits\/air\/trancehits\/2019-05-22\/00:20:21 -  - .mp3): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#284","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw838AAQEAAAbv8-sAAAAL","level":3,"time":"2019-05-23T19:13:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53508&c=9a49d0740a9112abe060fe6a9e37123d&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw838AAQEAAATlo4wAAAAD","level":3,"time":"2019-05-23T19:13:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53509&c=b6c14bdd4fe09a8ef189370946c4ceca&x=250&y=250&forceIcon=0","message":"fopen(\/media\/USBdrive\/ncdata\/ncp\/files\/Downloads\/Music\/Trance hits\/air\/trancehits\/2019-05-22\/00:20:23 - OCEANLAB-ABOVE &amp; BEYOND - Breaking Ties.mp3): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#284","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XObw838AAQEAAATlo4wAAAAD","level":3,"time":"2019-05-23T19:13:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/core\/preview?fileId=53509&c=b6c14bdd4fe09a8ef189370946c4ceca&x=250&y=250&forceIcon=0","message":"unlink(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Preview\/MP3.php#47","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XOcBIH8AAQEAAATgWKsAAAAC","level":3,"time":"2019-05-23T20:22:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/apps\/theming\/img\/core\/filetypes\/audio.svg?v=0","message":"file_get_contents(\/media\/USBdrive\/ncdata\/appdata_ockhnd03zkvv\/theming\/0\/icon-core-filetypes_audio.svg): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#216","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XOcBIH8AAQEAAATgWKsAAAAC","level":3,"time":"2019-05-23T20:22:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/apps\/theming\/img\/core\/filetypes\/audio.svg?v=0","message":"stat(): stat failed for \/media\/USBdrive\/ncdata\/appdata_ockhnd03zkvv\/theming\/0\/icon-core-filetypes_audio.svg at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#142","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XOcBIH8AAQEAAATgWKsAAAAC","level":3,"time":"2019-05-23T20:22:56+00:00","remoteAddr":"192.168.1.17","user":"ncp","app":"PHP","method":"GET","url":"\/index.php\/apps\/theming\/img\/core\/filetypes\/audio.svg?v=0","message":"filesize(): stat failed for \/media\/USBdrive\/ncdata\/appdata_ockhnd03zkvv\/theming\/0\/icon-core-filetypes_audio.svg at \/var\/www\/nextcloud\/lib\/private\/LargeFileHelper.php#171","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.2.0"}
{"reqId":"XOcGj38AAQEAABXnGBAAAAAG","level":2,"time":"2019-05-23T20:46:07+00:00","remoteAddr":"192.168.1.15","user":"--","app":"core","method":"POST","url":"\/index.php\/login","message":"Login failed: 'ncp' (Remote IP: '192.168.1.15')","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/71.0.3578.98 Safari\/537.36 OPR\/58.0.3135.132","version":"15.0.2.0"}

The output of your Nextcloud log in Admin > Logging:

Error	PHP	filesize(): stat failed for /media/USBdrive/ncdata/appdata_ockhnd03zkvv/theming/0/icon-core-filetypes_audio.svg at /var/www/nextcloud/lib/private/LargeFileHelper.php#171	
2019-05-23T23:22:56+0300
Error	PHP	stat(): stat failed for /media/USBdrive/ncdata/appdata_ockhnd03zkvv/theming/0/icon-core-filetypes_audio.svg at /var/www/nextcloud/lib/private/Files/Storage/Local.php#142	
2019-05-23T23:22:56+0300
Error	PHP	file_get_contents(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/theming/0/icon-core-filetypes_audio.svg): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#216	
2019-05-23T23:22:56+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:56+0300
Error	PHP	fopen(/media/USBdrive/ncdata/ncp/files/Downloads/Music/Trance hits/air/trancehits/2019-05-22/00:20:23 - OCEANLAB-ABOVE &amp; BEYOND - Breaking Ties.mp3): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-05-23T22:13:56+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:56+0300
Error	PHP	fopen(/media/USBdrive/ncdata/ncp/files/Downloads/Music/Trance hits/air/trancehits/2019-05-22/00:20:21 - - .mp3): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-05-23T22:13:56+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:56+0300
Error	PHP	fopen(/media/USBdrive/ncdata/ncp/files/Downloads/Music/Trance hits/air/trancehits/2019-05-22/00:15:30 - - .mp3): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-05-23T22:13:56+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:56+0300
Error	PHP	fopen(/media/USBdrive/ncdata/ncp/files/Downloads/Music/Trance hits/air/trancehits/2019-05-22/00:15:32 - FIRST STATE - Brave (Andy Moor rmx).mp3): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-05-23T22:13:56+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:55+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:55+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:55+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:55+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:55+0300
Error	PHP	unlink(): No such file or directory at /var/www/nextcloud/lib/private/Preview/MP3.php#47	
2019-05-23T22:13:54+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/updatenotification/35c3-5209-admin.css.gzip): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:19+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/theming/ca9f-6b9b-theming.css.gzip): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/systemtags/35c3-5209-systemtagsfilelist.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/systemtags/35c3-5209-systemtagsfilelist.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/support/47cd-5209-support.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/support/47cd-5209-support.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/support/47cd-5209-support.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/support/47cd-5209-support.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/settings/339f-6b9b-settings.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:18+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/settings/339f-6b9b-settings.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/settings/339f-6b9b-settings.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/notifications/70e2-6b9b-styles.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/notifications/70e2-6b9b-styles.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/notifications/70e2-5209-styles.css.gzip): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/notifications/70e2-5209-styles.css.gzip): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/notifications/70e2-5209-styles.css.gzip): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/firstrunwizard/0d6d-6b9b-firstrunwizard.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:17+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/files_texteditor/b1d7-6b9b-merged.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:16+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/files_texteditor/b1d7-6b9b-merged.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:16+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/files_sharing/6a15-5209-mergedAdditionalStyles.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:15+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/files_sharing/6a15-5209-mergedAdditionalStyles.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:15+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/files_external/ca9f-6b9b-settings.css.gzip): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:15+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/core/339f-6b9b-ie.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:13+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/core/339f-6b9b-ie.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:13+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/core/339f-6b9b-ie.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:13+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/core/339f-6b9b-ie.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:13+0300
Error	PHP	unlink(/media/USBdrive/ncdata/appdata_ockhnd03zkvv/css/core/339f-5209-server.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#227	
2019-03-26T23:47:12+0300

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

<?php
$CONFIG = array (
  'passwordsalt' => '*********',
  'secret' => '********',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    1 => '192.168.1.***',
    11 => '94.19.***.***',
    20 => 'cloud.local',
    21 => '****.rt3.io',

  ),
  'datadirectory' => '/media/USBdrive/ncdata',
  'dbtype' => 'mysql',
  'version' => '15.0.2.0',
  'overwrite.cli.url' => 'https://192.168.1.***/',
  'dbdir' => '/var/lib/mysql',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '**********',
  'installed' => true,
  'instanceid' => 'ockhnd03zkvv',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '*********',
  ),
  'tempdirectory' => '/media/USBdrive/ncdata/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'overwriteprotocol' => 'https',
  'auth.bruteforce.protection.enabled' => false,
  'maintenance' => false,
  'logfile' => '/media/USBdrive/ncdata/nextcloud.log',
  'loglevel' => '2',
  'log_type' => 'file',
  'jpeg_quality' => '60',
);

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

Cjmplaing only about certificate (using ncp locally without really true ssl certificate)

Hello,

Most of the times, the cause of the " Read Only " behavior is due to the format of the file system used on the usb device.

Many storage devices such as USB drives and external hard disk drives come pre-formatted in DOS/FAT/FAT32/NTFS because a larger number of consumers are using them on PCs.

And Unix/Linux system don’t like it !

You may try to fsck your usb disk.

ALSO, some tricky usb connection problems ( drivers related or hardware troubles ) can modify the state of a usb drive to “locked” in order to protec the files.

Thanks for the reply,
I have already known about format and first what I’ve done with the NextCloud - formatted the drive.
Software related doesn’t seem the reason also, actually before (in prev. month) it was working perfectly. The only possible change - update of nextcloud.

you may check if nextcloud locked an usb stick instead of a hdd …

If the stcik is locked too, this might be nextcloud 16. If not, then it is your usb/hdd