zammad / zammad-docker-compose

Zammad Docker images for docker-compose
https://hub.docker.com/r/zammad/zammad-docker-compose/
GNU Affero General Public License v3.0
268 stars 207 forks source link

The reason zammad-init container can't not connect Postgres some time #393

Closed chendelin1982 closed 8 months ago

chendelin1982 commented 8 months ago

Infos

Expected behavior

I found the reason that some time zammad-init container can't not connect Postgres.

Because that zammad-init container will use PostgreSQL URI for connection to Postgres, and you know that PostgreSQL URI have some special string limit

Actual behavior

*

Steps to reproduce the behavior

*

mgruner commented 8 months ago

Hi @chendelin1982. I'm not sure this is actually a bug in Zammad. Using zammad-01uh9-postgresql instead of zammad_01uh9-postgresql does work, so it is probably not a length limit of the string.

Please feel free to provide more information if you believe this is a bug in the Zammad codebase.

chendelin1982 commented 8 months ago

Hi @chendelin1982. I'm not sure this is actually a bug in Zammad. Using zammad-01uh9-postgresql instead of zammad_01uh9-postgresql does work, so it is probably not a length limit of the string.

Please feel free to provide more information if you believe this is a bug in the Zammad codebase.

Hi, thanks for your reply. I need to clarify my previous description. It shouldn't be a length limit, but rather a format limit. The Zammad container used a URI for the database connection.

In URI standards, the hostname part (also known as the network location or authority) typically follows DNS specifications, which means it should be a valid domain name or IP address. According to DNS specifications, hostnames can include letters, numbers, and hyphens (-), but cannot contain underscores (_).

If you have used an underscore in the URI, this could be the reason for the URI::InvalidURIError.