R
Railwayโ€ข13mo ago
Bad Messages

Python with Node

Hello, We are having a bit of trouble providing a multi-service application that utilizes Node and Python on one of the services. The issue is nodenv is failing to install and then failing the subsequent npm install/build steps. Our nixpacks.toml: https://github.com/litestar-org/litestar-fullstack/blob/main/nixpacks.toml is there something we are missing?
#12 31.94 Installing the project as an editable package...

#12 34.02 โœ” Install app 0.1.0 successful

#12 34.02
#12 34.02 ๐ŸŽ‰ All complete!
#12 34.02

#12 34.97 Inside an active virtualenv /opt/venv, reusing it.
#12 34.97 Set env var PDM_IGNORE_ACTIVE_VENV to ignore it.

#12 35.11 Traceback (most recent call last):
#12 35.11 File "/app/scripts/pre-build.py", line 36, in <module>
#12 35.11 build_npm_assets({})
#12 35.11 File "/app/scripts/pre-build.py", line 28, in build_npm_assets
#12 35.11 subprocess.run([nodeenv_command, install_dir, "--force", "--quiet"], **kwargs) # noqa: PLW1510
#12 35.11 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 35.12 File "/root/.nix-profile/lib/python3.11/subprocess.py", line 548, in run
#12 35.12 with Popen(*popenargs, **kwargs) as process:
#12 35.12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 35.12 File "/root/.nix-profile/lib/python3.11/subprocess.py", line 1026, in __init__
#12 35.12 self._execute_child(args, executable, preexec_fn, close_fds,
#12 35.12 File "/root/.nix-profile/lib/python3.11/subprocess.py", line 1950, in _execute_child
#12 35.12 raise child_exception_type(errno_num, err_msg, err_filename)
#12 35.12 FileNotFoundError: [Errno 2] No such file or directory: 'nodeenv'
#12 31.94 Installing the project as an editable package...

#12 34.02 โœ” Install app 0.1.0 successful

#12 34.02
#12 34.02 ๐ŸŽ‰ All complete!
#12 34.02

#12 34.97 Inside an active virtualenv /opt/venv, reusing it.
#12 34.97 Set env var PDM_IGNORE_ACTIVE_VENV to ignore it.

#12 35.11 Traceback (most recent call last):
#12 35.11 File "/app/scripts/pre-build.py", line 36, in <module>
#12 35.11 build_npm_assets({})
#12 35.11 File "/app/scripts/pre-build.py", line 28, in build_npm_assets
#12 35.11 subprocess.run([nodeenv_command, install_dir, "--force", "--quiet"], **kwargs) # noqa: PLW1510
#12 35.11 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 35.12 File "/root/.nix-profile/lib/python3.11/subprocess.py", line 548, in run
#12 35.12 with Popen(*popenargs, **kwargs) as process:
#12 35.12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 35.12 File "/root/.nix-profile/lib/python3.11/subprocess.py", line 1026, in __init__
#12 35.12 self._execute_child(args, executable, preexec_fn, close_fds,
#12 35.12 File "/root/.nix-profile/lib/python3.11/subprocess.py", line 1950, in _execute_child
#12 35.12 raise child_exception_type(errno_num, err_msg, err_filename)
#12 35.12 FileNotFoundError: [Errno 2] No such file or directory: 'nodeenv'
GitHub
litestar-fullstack/nixpacks.toml at main ยท litestar-org/litestar-fu...
Litestar Fullstack Reference Application with Vue, Vite, SQLAlchemy, Docker, Task Queues, and more! - litestar-org/litestar-fullstack
Solution:
build works https://github.com/brody192/litestar-fullstack/commit/ff5743a9c1f6dc728cea86b483f567048cc86006 though im getting No such command 'database'. during runtime, any idea on that?...
Jump to solution
29 Replies
Percy
Percyโ€ข13mo ago
Project ID: 6f1f252f-a6f4-42ab-a5c7-6ba05c3f74de
Bad Messages
Bad MessagesOPโ€ข13mo ago
6f1f252f-a6f4-42ab-a5c7-6ba05c3f74de
Brody
Brodyโ€ข13mo ago
๐Ÿ‘‹ going to attempt a deploy now im getting OSError: Could not find a suitable TLS CA certificate bundle and thats a certi issue or whatever the package name is
Bad Messages
Bad MessagesOPโ€ข13mo ago
The PR#101 is updating that package, I think each time they have an updated it breaks everyones stuff
Brody
Brodyโ€ข13mo ago
indeed is does, but pr101 also has changes made to the nixpacks.toml file, can you revert those to the same nixpacks.toml in main?
Bad Messages
Bad MessagesOPโ€ข13mo ago
Hmm it shouldnt anymore, i reverted them after testing
Brody
Brodyโ€ข13mo ago
okay cool, looking
Bad Messages
Bad MessagesOPโ€ข13mo ago
its time for the sleep, i will check back in the am to see the news
Brody
Brodyโ€ข13mo ago
salute
Solution
Brody
Brodyโ€ข13mo ago
build works https://github.com/brody192/litestar-fullstack/commit/ff5743a9c1f6dc728cea86b483f567048cc86006 though im getting No such command 'database'. during runtime, any idea on that?
Bad Messages
Bad MessagesOPโ€ข13mo ago
i think we can figure out that part :0. thanks! ๐Ÿ˜„
Brody
Brodyโ€ข13mo ago
any questions on the changes I've made, since I did edit the litestar code and not just the nixpacks.toml perhaps there's a better way to skip that npm build assets function, since node is installed and the frontend is built in nixpacks, it both doesn't make sense to run that stuff again, and running it again causes errors
Bad Messages
Bad MessagesOPโ€ข13mo ago
thank you. going to test it after my standup
Brody
Brodyโ€ข13mo ago
sounds good!
Bad Messages
Bad MessagesOPโ€ข13mo ago
Do you happen to know why redis and postgres are having these issues? Not sure if this is something to do with the volumes or the way i set up the services
initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
...
initdb: detail: It contains a lost+found directory, perhaps due to it being a mount point.
initdb: hint: Using a mount point directly as the data directory is not recommended.
Create a subdirectory under the mount point.

edis 15:59:53.17 INFO ==> ** Starting Redis setup **
redis 15:59:53.19 INFO ==> Initializing Redis
mkdir: cannot create directory '/bitnami/redis': Permission denied
initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
...
initdb: detail: It contains a lost+found directory, perhaps due to it being a mount point.
initdb: hint: Using a mount point directly as the data directory is not recommended.
Create a subdirectory under the mount point.

edis 15:59:53.17 INFO ==> ** Starting Redis setup **
redis 15:59:53.19 INFO ==> Initializing Redis
mkdir: cannot create directory '/bitnami/redis': Permission denied
Brody
Brodyโ€ข13mo ago
are these from the standard deployments of the databases? + New > database > postgres / redis
Bad Messages
Bad MessagesOPโ€ข13mo ago
yeah the only thing ive done is fix the first error on each (missing passwords) deleting them and the volumes and recreating seems to have worked this time actually
Brody
Brodyโ€ข13mo ago
yeah was just gonna say, just deployed a postgres database and it worked
Bad Messages
Bad MessagesOPโ€ข13mo ago
ty for your help again! ๐Ÿ™‚
Brody
Brodyโ€ข13mo ago
wanted to ask you about the database scheme thing, your framework requires the postgresql+asyncpg scheme, but the databases from railway come with just postgresql by default, do you plan to patch this away in your framework or update the database url in a template?
Bad Messages
Bad MessagesOPโ€ข13mo ago
Yeah i just hit that.. I am not sure. It's kindve lame to not be able to use the dynamic URLs as they would change quite often I think? Is there a way to make ${{Postgres.DATABASE_URL}} use postgresql+asyncpg://?
Brody
Brodyโ€ข13mo ago
if you plan to use a template, you can add a custom postgres service to your template and edit its DATABASE_URL and DATABASE_PRIVATE_URL scheme
Bad Messages
Bad MessagesOPโ€ข13mo ago
ahhh
Brody
Brodyโ€ข13mo ago
when i say "postgres service" i dont mean this, you cant edit the variables on the built in postgres database, you would need to add a postgres database as a service to the template
No description
Brody
Brodyโ€ข13mo ago
to add an editable postgres service to your template you can use this https://bookmarklets.up.railway.app/service-embed/
Bad Messages
Bad MessagesOPโ€ข13mo ago
I might be dumb, how do i use this? Am i putting the shortcode for a postgres template to add to my template, or am i using the shortcode of my template and then pulling it from somewhere else? oh yeah, the 1st one. i was doing the 2nd Oh man his is badass. I love railway ๐Ÿ˜…``
Brody
Brodyโ€ข13mo ago
dont give railway credit for that lol i made it ๐Ÿ˜†
Bad Messages
Bad MessagesOPโ€ข13mo ago
Oh man this is badass. I love Brody ๐Ÿ˜…
Brody
Brodyโ€ข13mo ago
just be carefull, if you add a service you wont be able to remove it and i cant make a bookmarklet to remove a service since there is no api to do so
Want results from more Discord servers?
Add your server