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

AccessPolicy.php Fails to connect to DB after updating docker from 0.14.1 to v1+ #300

Open
3 tasks done
siimpliidiip opened this issue Sep 14, 2024 · 1 comment
Open
3 tasks done

Comments

@siimpliidiip
Copy link

siimpliidiip commented Sep 14, 2024

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I've recently been migrating my Self-Hosted to Docker but when going from v 0.14.1 to v1, I'm encountering some issues with connecting to the MariaDB. This coincides with the change to use AccessPolicy.php.

Expected behaviour

Seemless connection to the DB.

Actual behaviour

Incoming mail is getting rejected

mail postfix/smtpd[1164]: warning: problem talking to server private/policy: Application error

NOQUEUE: reject: RCPT from mail-qt1-f181.google.com[209.85.160.181]: 451 4.3.5 <xxxxx@xxxx.xxxx.xxx>: Recipient address rejected: Server configuration problem; from=<xxxxxx@gmail.com> to=<xxxxx@xxxx.xxxx.xxx> proto=ESMTP helo=<mail-qt1-f181.google.com>

Postfix Php Logs

SQLSTATE[HY000] [1045] Access denied for user 'anonaddy'@'192.168.112.3' (using password: NO) (Connection: default, SQL: select exists(select idfromaliaseswhereemail= xxxxx@xxxx.xxxx.xxx) asexists`)

Steps to reproduce

Start with a docker container older than 0.14.1 and migrate to a container newer than 1.0.0

Docker info

lient:
Version:    26.1.5
Context:    default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version:  v0.14.0
Path:     /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version:  v2.27.0
Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
Containers: 8
Running: 8
Paused: 0
Stopped: 0
Images: 10
Server Version: 26.1.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 3a4de459a68952ffb703bbe7f2290861a75b6b67
runc version: 51d5e94601ceffbbd85688df1c928ecccbfa4685
init version:
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.6.43-0-lts
Operating System: Alpine Linux v3.20
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 963.2MiB
Name: XXXXXX
ID: 7514abbe-c66a-4103-baa4-9d5ea261469f
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Docker Compose config

No response

Logs

as above

Additional info

No response

@siimpliidiip
Copy link
Author

While troubleshooting, I noticed that if you replace the $_ENV['DB_PASSWORD"] with the actual password. It works perfectly.
The clue was the PHP Logs showing that login was "(using password: NO)". Other parts of the Application accurately retrieve the value from the ENV variables. Another aspect of it is that my password starts with the '#' character. I'm not well versed enough in PHP / Laravel and with phpdotenv to know how the variable is resolved and if it could be that my password is getting commented out (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant