Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Use minIO to be primary storage miss .ocdata problem #48441

Closed
5 of 8 tasks
leo03164 opened this issue Sep 29, 2024 · 3 comments
Closed
5 of 8 tasks

[Bug]: Use minIO to be primary storage miss .ocdata problem #48441

leo03164 opened this issue Sep 29, 2024 · 3 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@leo03164
Copy link

⚠️ This issue respects the following points: ⚠️

Bug description

I am using minIO to be my primary storage.
I use docker compose to setup my nextcloud server.
截圖 2024-09-29 下午1 52 08

First Time
I reset my nextcloud's db and minIO bucket to empty
I also keep config file to empty (I didn't create it)
When I docker compose up to start my nextcloud
Everything are work fine
The init media and file also upload to my minio server
When I use docker compose down to close nextcloud server

Second Time
I use docker compose up start the nextcloud server again
This time we keep the origin config file
The bad thing is happen
The nextcloud show me data folder is invalid and please check .ocdata is exist
截圖 2024-09-29 下午1 58 08

I try to figure out it, so I use docker logs to show the log like following
docker logs nextcloud
Initializing nextcloud 29.0.4.1 ...
New nextcloud instance
Installing with MySQL database
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-installation
Starting nextcloud installation
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/html/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/html/console.php(101): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/occ(11): require_once('/var/www/html/c...')
#2 {main}Retrying install...
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.

I think this is a bug
It look like if you use minIO to be primary storage
you must lost the .ocdata, but I think this is incorrect

This is my env info

Config

REVERSE_PROXY_NETWORK=micro-service
DOMAIN=example.com

Resource limits

CPUS=4
MEMORY_BYTES=4g # 4GB in bytes

Nextcloud Docker settings

NEXTCLOUD_IMAGE=nextcloud:29.0.4-apache
NEXTCLOUD_CONTAINER_NAME=nextcloud

Database settings (MySQL or MariaDB)

DB_HOST=192.168.2.249
DB_NAME=nextcloud_minio
DB_USER=nextcloud
DB_PASSWORD=passwd

Nextcloud admin user

NEXTCLOUD_ADMIN_USER=nextcloud
NEXTCLOUD_ADMIN_PASSWORD=passwd

MinIO (S3-compatible) settings

OBJECTSTORE_S3_HOST=minio-cluster.localdomain
OBJECTSTORE_S3_PORT=80
OBJECTSTORE_S3_REGION=eu-west-1
OBJECTSTORE_S3_BUCKET=nextcloud-test
OBJECTSTORE_S3_ACCESS_KEY=xxx
OBJECTSTORE_S3_SECRET_KEY=ooo
OBJECTSTORE_S3_USE_SSL=false
OBJECTSTORE_S3_USE_PATH_STYLE=true

Steps to reproduce

  1. reset db & minIO bucket & config
  2. docker compose up -d
  3. login to admin user
  4. docker compose down
  5. docker compose up -d
  6. missed .ocdata :(

Expected behavior

I think the .ocdata shouldn't happen when I use docker compose down & up
Everything like no change

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@leo03164 leo03164 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 29, 2024
@susnux
Copy link
Contributor

susnux commented Sep 29, 2024

This is a configuration issue of your setup.

You need to also persist the data directory even if you use object storage as primary storage. There (could be / are) still some (small) files written to that directory for compatibility reasons, see also documentation:

By default, files are stored in nextcloud/data or another directory configured in the config.php of your Nextcloud instance. This data directory might still be used for compatibility reasons)

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html

@susnux susnux closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2024
@joshtrichards
Copy link
Member

You need to persist /var/www/html on a named volume (or equivalent / at a minimum). You don't have a fully functioning setup. Please see: https://github.com/nextcloud/docker/?tab=readme-ov-file#persistent-data

@leo03164
Copy link
Author

Thank you everybody to answer my question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

3 participants