I am getting postgres 16 Issue
#8 30.90 error: collision between
/nix/store/cpmgrq24rjqf415q3m4a5mlg9fw5x9r0-postgresql-16.0/lib/libpgport.a' and
/nix/store/frsl3935sgp53hdgmmknhbl33d4fb7nn-postgresql-14.9/lib/libpgport.a'
#8 ERROR: process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d" did not complete successfully: exit code: 100
-----
30.90 error: collision between /nix/store/cpmgrq24rjqf415q3m4a5mlg9fw5x9r0-postgresql-16.0/lib/libpgport.a' and
/nix/store/frsl3935sgp53hdgmmknhbl33d4fb7nn-postgresql-14.9/lib/libpgport.a'
30.97 error: builder for '/nix/store/h1y4fdw7n62z5gq939nyqn2nz4lxhk34-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db-env.drv' failed with exit code 25
-----
Dockerfile:8
-------------------
6 |
7 | COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix
8 | >>> RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d
9 |
10 |
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d" did not complete successfully: exit code: 100
Error: Docker build failed
I want to remove 14.9
and only keep 16
NIXPLACK.TOML
[phases.setup]
nixPkgs = ['...', 'postgresql_16']53 Replies
Project ID:
0102b03a-4031-4647-8b11-de7393658d31
0102b03a-4031-4647-8b11-de7393658d31
what do you mean "I want to remove 14.9"?
Its saying that collision in 14.9 and 16 ryt so If we try to remove 14.9 and just keep 16
Anyways I just want postgres 16
It was working last week and this week it suddenly like this
to help me understand this better, do you think you could let me know why you need to install postgres in the first place?
My project needs postgresql to be installed
I am using psycopg2 binary
might be better to switch to a Dockerfile based build for this kind of thing, heres an example of how you would install postgresql_16 with a Dockerfile
https://github.com/railwayapp-templates/postgres-s3-backups/blob/main/Dockerfile#L24-L26
ohhk
let me know if you need any help with that!
Btw cant we just change nixpack.toml and do this ??
Cause I didnt worked on dockerfile much
from your error message, it seems not
if you wanna share your repo with me id be happy to write the entire dockerfile for you!
Sure but is it safe to share here ?
Cause its private
you want to just add me?
yah so that you can check for details
brody192
ohhk sure just a min
also, we are the only two people in this thread, you dont need to directly reply to my messages
ohhk
check I gave you
7.8k line main.py file, thats impressive
I am just a student tho
Trying to increase skills
you install the
psycopg2-binary
python module, are you sure you even need to install any postgresql package?The server I am using is on version 16 so I have to install postgresql_16
and If I try not to install postgresql
My backup.py file will not work
remove or rename the nixpacks.toml file please
id like to at least see the error you would get please
ohk
Traceback (most recent call last):
File "/opt/venv/lib/python3.11/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backup.py", line 97, in backup_database
pg_dump(url.host, url.port, url.database, url.username, out=BACKUPFILE, password=url.password)
File "/app/backup.py", line 62, in pg_dump
raise e
File "/app/backup.py", line 59, in pg_dump
raise subprocess.CalledProcessError(result.returncode, command)
subprocess.CalledProcessError: Command '['/root/.nix-profile/bin/pg_dump', '--host=viaduct.proxy.rlwy.net', '--port=37507', '--dbname=railway', '--username=postgres', '--no-password', '--no-acl', '--no-owner', '-f', 'backup.pg']' returned non-zero exit status 1.
gotcha, thanks, i see whats going on now, first, we need some code changes
please use environment variables for your
urll
variable
dont hardcode the pg_dump_path
, subprocess.run
should be able to find pg_dump
on its ownCan you help in this please
I dont have much knowledge abt it
sure, screenshot of your railway project please
Of which part
the entire browser viewport
wheres your database?
hosted on my friends account
want credentials ??
i havent heard that one before
I have telegram friends and I hosted code on my acc and database on his
either way, add a
DATABASE_URL
variable to your service variables with the database url as its valueohhk
Done added
this line https://github.com/Kakashi219/tutorial/blob/main/backup.py#L22
should be
urll = os.getenv("DATABASE_URL")
Ohhk
I changed it
delete line 42 and set line 44 to
"pg_dump",
Ohk changes done
okay ill write the dockerfile and get back to you shortly
Ohhk Sir thank you
i think this is a good starting point, put this into a
Dockerfile
in your repo
Ohhk let me do this
please enclose that in triple backticks
Ok Im sorry
check
File "/app/backup.py", line 104, in backup_database
we didnt do anything on line 104, so this would be a code issue
but your code is able to run pg_dump
or else it wouldnt even get to line 104Its saying Internal Server Error
So I asked is this due to our changes or something
Yah dump is working
Ok It worked
It was Telegram Servers Issues Ig
awsome
Thank You Sir for your precious time
happy to help!
Thank You again
Have a nice day ahead
no problem, you too!