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

Escaping characters in database url variable #698

Open
kalxasus opened this issue Apr 11, 2024 · 1 comment
Open

Escaping characters in database url variable #698

kalxasus opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kalxasus
Copy link

I trying run planka with variable:

DATABASE_URL=postgresql://planka:aeN=oongee\T8gie@172.172.172.222:5432/planka

And on start get this error:

2024-04-11 06:45:16 [E] A hook (`orm`) failed to load!
2024-04-11 06:45:16 [E] Failed to lift app: `getConnection` failed ("failed").  Could not acquire a connection to the database using the specified manager.
Additional data:

{
  error: Error: connect ECONNREFUSED 172.31.0.2:5432
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '172.31.0.2',
    port: 5432
  },
  meta: undefined
}
2024-04-11 06:45:16 [E] More details (raw):

I was confusing by this message, why his try connect to internal container IP address. And in a same time on every try starting container, in postgresql created db structure and seen error in postgresql log:
ERROR: conflicting key value violates exclusion constraint "user_email_unique"

when service try to create admin user in DB.

I spent a lot of time, to try run service via helm or docker-compose before I understood that problem in character \ in connection password.

@meltyshev
Copy link
Member

Hi! Thanks for reporting this.

I don't understand how to fix this yet, it seems that the adapter doesn't connect if there is a backslash in DATABASE_URL (even if escaped), for some reason it automatically replaces it with a normal slash when connecting. The only way to get around this quickly is to not use them in DATABASE_URL.

And in a same time on every try starting container, in postgresql created db structure and seen error in postgresql log:
ERROR: conflicting key value violates exclusion constraint "user_email_unique"
when service try to create admin user in DB.

This is the correct behavior, it tries to create an administrator on startup every time (in case it's suddenly deleted). Seems like we should hide this message because it's confusing.

@meltyshev meltyshev added the bug Something isn't working label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants