#Python with Node

39 messages · Page 1 of 1 (latest)

ruby sorrel
#

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'
GitHub

Litestar Fullstack Reference Application with Vue, Vite, SQLAlchemy, Docker, Task Queues, and more! - litestar-org/litestar-fullstack

humble valeBOT
#

Project ID: 6f1f252f-a6f4-42ab-a5c7-6ba05c3f74de

ruby sorrel
#

6f1f252f-a6f4-42ab-a5c7-6ba05c3f74de

tired widget
#

👋

#

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

ruby sorrel
#

The PR#101 is updating that package, I think each time they have an updated it breaks everyones stuff

tired widget
#

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?

ruby sorrel
#

Hmm it shouldnt anymore, i reverted them after testing

tired widget
#

okay cool, looking

ruby sorrel
#

its time for the sleep, i will check back in the am to see the news

tired widget
tired widget
ruby sorrel
#

i think we can figure out that part :0. thanks! 😄

tired widget
#

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

ruby sorrel
#

thank you. going to test it after my standup

tired widget
#

sounds good!

ruby sorrel
#

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
tired widget
#

are these from the standard deployments of the databases?

#

+ New > database > postgres / redis

ruby sorrel
#

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

tired widget
#

yeah was just gonna say, just deployed a postgres database and it worked

ruby sorrel
#

ty for your help again! 🙂

rain tapirBOT
tired widget
#

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?

ruby sorrel
#

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://?

tired widget
#

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

ruby sorrel
#

ahhh

tired widget
#

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

ruby sorrel
#

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 😅``

tired widget
#

dont give railway credit for that lol
i made it 😆

ruby sorrel
#

Oh man this is badass. I love Brody 😅

tired widget
#

just be carefull, if you add a service you wont be able to remove it