nextcloud / nextcloud/nextcloudpi

Ownership missmatch for mariadb and redis running lxc container on proxmox and wrong dbpassword

Open
#2,037 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
2.9k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

Hi Folks,

I ran the current LXC Image NextcloudPi_LXC_x86_v1.55.3.tar.gz on proxmox 8.3.2.
The activation page didn't work. After looking through the logs I found ownership missmatch for mariadb and redis.

# id mysql
uid=101(mysql) gid=108(mysql) groups=108(mysql)

# ls -landh /var/lib/mysql/ 
drwxr-xr-x 6 991 993 4.0K Nov  8 20:44 /var/lib/mysql/
# id redis
uid=103(redis) gid=112(redis) groups=112(redis)

# ls -landh /var/lib/redis/ /var/log/redis/
drwxr-x--- 2 101 103 4.0K Nov  8 20:44 /var/lib/redis/
drwxr-s--- 2 101   4 4.0K Nov  8 20:44 /var/log/redis

Workaround to solve the issue (run commands as root):

chown -R redis:redis /var/lib/redis/ /var/log/redis/ 
chown -R mysql:mysql /var/lib/mysql/
chmod -R o+Xr /etc/redis/
systemctl start mariadb
systemctl start redis

After that I ran in the next issue clicking on activate:
/var/log/ncp.log

Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'ncadmin'@'localhost' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:233

My Workaround:

dbpassword=$(grep dbpassword /var/www/nextcloud/config/config.php | sed "s|^.*=> '||g; s|',$||g")
echo $dbpassword
echo "SET PASSWORD FOR 'ncadmin'@'localhost' = PASSWORD('$dbpassword');"  | mysql

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NextcloudPi_LXC_x86_v1.55.3.tar.gz release and inspect the setup around /var/lib/mysql, /var/lib/redis, /var/log/redis, and /etc/redis. Reproduce activation on Proxmox 8.3.2, then use /var/log/ncp.log and the reported ownership and password workarounds to trace the failure. Done means activation connects successfully without these manual commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, redis
Domain
databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.