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

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

Open
lqb opened this issue Feb 17, 2025 · 0 comments

Comments

@lqb
Copy link

lqb commented Feb 17, 2025

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
@lqb lqb changed the title Ownership missmatch for mariadb and redis running lxc container on proxmox Ownership missmatch for mariadb and redis running lxc container on proxmox and wrong dbpassword Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant