Nextcloud Docker (power failur simulation)

Hi Guys,

i have some serious problemes with my nc-docker setup. I already asked the stack community but it seems that nobody can help me.

Could you please help me to make my nc setup power failur secure.

Thanks for any help :raised_hands::muscle:

hello @Corepex welcome to the community :handshake:

You are missing the required support template. Please fill this form out and edit into your post. Please post your docker-compose file.

This will give us the technical info and logs needed to help you in case the machine in question in spitting out errors! Since you’ve provided zero technical details it is impossible to help you as-is. Thanks.

There are good basic examples where you can start at the project homepage

@wwe i thought i wrote all important infos into my question on stack - but i will repeat it here:

Steps to reproduct:

  1. get your Raspi (in my case a Raspi4 (8GB RAM))

  2. get an external ssd

  3. setup raspian (raspberrypi os) and mount the ssd (via fstab) - in my case on /mnt/ssd

  4. install docker (& docker-compose)

  5. take the default nextcloud docker-compose.yml file (see my slightly modified file below)

  6. bring the containers up with docker compose up -d

  7. check if everything works as expected (visit the webUI or whatever)

  8. reboot the pi sudo reboot

If the pi is up again you will notice that something (or better the complete nc setup) doesnt work anymore! you can reload the webUI and after the second time (loads until death) nc and the complete external SSD will die.

Now you can remove the docker container manually docker container rm -f nextcloud-* and reboot the pi. - At this point you can repeat the steps 1.-9 until you give up and ask some other guys in the nc forum :stuck_out_tongue:

version: '2'

services:
  db:
    image: mariadb:10.5
    container_name: nextcloud-db
    networks:
      - backend
    #restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=nextcloud
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    container_name: nextcloud-app
    #restart: always
    ports:
      - 8081:80
    networks:
      - nginxproxymanager_frontend
      - backend
    links:
      - db
    volumes:
      - ./app:/var/www/html
    environment:
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

networks:
  nginxproxymanager_frontend:
    external: true
  backend:

btw. the restart policy of the containers (the restart param) doesnt affect the result - so it doesnt matter what you choose here.

here are some loglines of the nextcloud-db container. The nextcloud-app container doesnt print anything except the standard connection output!

2022-10-19 19:50:30+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-10-19 19:50:30 0 [Note] mysqld (mysqld 10.5.17-MariaDB-1:10.5.17+maria~ubu2004) starting as process 1 ...
2022-10-19 19:50:30 0 [Warning] You need to use --log-bin to make --binlog-format work.
2022-10-19 19:50:30 0 [Note] InnoDB: Uses event mutexes
2022-10-19 19:50:30 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-10-19 19:50:30 0 [Note] InnoDB: Number of pools: 1
2022-10-19 19:50:30 0 [Note] InnoDB: Using ARMv8 crc32 instructions
2022-10-19 19:50:30 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-10-19 19:50:30 0 [Note] InnoDB: Using Linux native AIO
2022-10-19 19:50:30 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-10-19 19:50:30 0 [Note] InnoDB: Completed initialization of buffer pool
2022-10-19 19:50:30 0 [Note] InnoDB: 128 rollback segments are active.
2022-10-19 19:50:30 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-10-19 19:50:30 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-10-19 19:50:30 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-10-19 19:50:30 0 [Note] InnoDB: 10.5.17 started; log sequence number 1255926; transaction id 2656
2022-10-19 19:50:30 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-10-19 19:50:30 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-10-19 19:50:30 0 [Note] Server socket created on IP: '::'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./mysql/gtid_slave_pos.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './mysql/gtid_slave_pos.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_migrations.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_migrations.ibd'.
2022-10-19 19:52:04 0 [ERROR] [FATAL] InnoDB: IO Error: 5 during async read of 16384 bytes, for file 18, returned 0
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
221019 19:52:04 2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
[ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 10.5.17-MariaDB-1:10.5.17+maria~ubu2004
key_buffer_size=134217728
read_buffer_size=131072
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_appconfig.ibd: 'open' returned OS error 230.
max_used_connections=0
max_threads=153
thread_count=1
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467880 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_appconfig.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_storages.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_storages.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_mounts.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_mounts.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_mimetypes.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_mimetypes.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_filecache.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_filecache.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_group_user.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_group_user.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_group_admin.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_group_admin.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_groups.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_groups.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_preferences.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_preferences.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_properties.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_properties.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_share.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_share.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_jobs.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_jobs.ibd'.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect file format 'db'
2022-10-19 19:52:04 0 [ERROR] Aborting
2022-10-19 19:52:04 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-19 19:52:04 0 [ERROR] InnoDB: File ./nextcloud/oc_users.ibd: 'open' returned OS error 230.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Operating system error number 30 in a file operation.
2022-10-19 19:52:04 0 [ERROR] InnoDB: Error number 30 means 'Read-only file system'
2022-10-19 19:52:04 0 [Warning] InnoDB: Cannot open './nextcloud/oc_users.ibd'.
2022-10-19 19:52:04 0 [ERROR] [FATAL] InnoDB: IO Error: 5 during async read of 16384 bytes, for file 18, returned 0

You’re having disk related issues at the OS level

[ERROR] InnoDB: Operating system error number 30 in a file operation.

Search for this error and you can find related articles

Here’s one

Especially this post

1 Like

I dont think that it its an hardware issue - other containers (om the same pi AND also on the same disc (ssd)) start (and work) normally

Well that is what the error codes are implying but I don’t know, there’s also this

2022-10-19 19:50:30 0 [Warning] You need to use --log-bin to make --binlog-format work.