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

deploy with external pgsql fail #209

Open
superstring opened this issue Nov 3, 2024 · 1 comment
Open

deploy with external pgsql fail #209

superstring opened this issue Nov 3, 2024 · 1 comment

Comments

@superstring
Copy link

start command

docker run -d \
  --name briefer \
  -p 8010:3000 \
  -v briefer_jupyter_data:/home/jupyteruser \
  -v briefer_briefer_data:/home/briefer \
  -e POSTGRES_HOSTNAME=**** \
  -e POSTGRES_PORT=5432 \
  -e POSTGRES_DATABASE=postgres \
  -e POSTGRES_USERNAME=postgres \
  -e POSTGRES_PASSWORD=*** \
  briefercloud/briefer:v0.0.55

error log

    }
2024-11-03 15:10:36,552 WARN stopped: api (terminated by SIGTERM)
2024-11-03 15:10:36,553 INFO reaped unknown pid 2338 (exit status 0)
2024-11-03 15:10:37,556 WARN stopped: jupyter (terminated by SIGTERM)
2024-11-03 15:10:37,556 INFO reaped unknown pid 2340 (exit status 0)
2024-11-03 15:10:38.558 UTC [8] LOG:  received smart shutdown request
2024-11-03 15:10:38.566 UTC [8] LOG:  background worker "logical replication launcher" (PID 27) exited with exit code 1
2024-11-03 15:10:38.567 UTC [20] LOG:  shutting down
2024-11-03 15:10:38.567 UTC [20] LOG:  checkpoint starting: shutdown immediate
2024-11-03 15:10:38.607 UTC [20] LOG:  checkpoint complete: wrote 1016 buffers (6.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.025 s, sync=0.014 s, total=0.041 s; sync files=455, longest=0.009 s, average=0.001 s; distance=5283 kB, estimate=5283 kB
2024-11-03 15:10:38,608 INFO waiting for postgres to die
2024-11-03 15:10:38.623 UTC [8] LOG:  database system is shut down
2024-11-03 15:10:38,626 INFO stopped: postgres (exit status 0)
2024-11-03 15:10:40,232 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2024-11-03 15:10:40,232 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2024-11-03 15:10:40,236 INFO RPC interface 'supervisor' initialized
2024-11-03 15:10:40,236 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-11-03 15:10:40,236 INFO supervisord started with pid 1
2024-11-03 15:10:41,242 INFO spawned: 'postgres' with pid 8
2024-11-03 15:10:41,247 INFO spawned: 'init_db' with pid 9
2024-11-03 15:10:41,251 INFO spawned: 'setup' with pid 10
2024-11-03 15:10:41,253 INFO spawned: 'jupyter' with pid 11
2024-11-03 15:10:41,256 INFO spawned: 'api' with pid 12
2024-11-03 15:10:41,258 INFO spawned: 'web' with pid 14
2024-11-03 15:10:41,260 INFO spawned: 'nginx' with pid 15
2024-11-03 15:10:41.307 UTC [8] LOG:  starting PostgreSQL 15.8 (Debian 15.8-0+deb12u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-03 15:10:41,307 INFO success: init_db entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-11-03 15:10:41,307 INFO success: setup entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-11-03 15:10:41,307 INFO success: jupyter entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-11-03 15:10:41,307 INFO success: api entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-11-03 15:10:41,307 INFO success: web entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-11-03 15:10:41.307 UTC [8] LOG:  listening on IPv6 address "::1", port 5432
2024-11-03 15:10:41.307 UTC [8] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2024-11-03 15:10:41.308 UTC [8] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Waiting for Web and API services to be reachable...
2024-11-03 15:10:41.316 UTC [24] LOG:  database system was shut down at 2024-11-03 15:10:38 UTC
INFO:root:Reading config file
INFO:root:Reading config file
INFO:root:Running API
2024-11-03 15:10:41.328 UTC [8] LOG:  database system is ready to accept connections
2024-11-03 15:10:41,350 INFO exited: init_db (exit status 0; expected)
INFO:root:Starting setup
INFO:root:Apps config exists, loading
INFO:root:Setting up postgres
INFO:root:Postgres is ready
INFO:root:Changing default user password
INFO:root:Password changed
INFO:root:Running migrations
  ▲ Next.js 13.5.5
  - Local:        http://localhost:4000
  - Network:      http://0.0.0.0:4000

 ✓ Ready in 203ms
[I 2024-11-03 15:10:42.474 ServerApp] Extension package jupyterlab took 0.2022s to import
2024-11-03 15:10:42,474 INFO success: postgres entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-11-03 15:10:42,474 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Prisma schema loaded from packages/database/prisma/schema.prisma
Datasource "db": PostgreSQL database "briefer", schema "public" at "localhost:5432"

19 migrations found in prisma/migrations


No pending migrations to apply.
[I 2024-11-03 15:10:43.169 ServerApp] jupyter_briefer_extension | extension was successfully linked.
[I 2024-11-03 15:10:43.169 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-11-03 15:10:43.177 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-11-03 15:10:43.185 ServerApp] jupyterlab | extension was successfully linked.
(node:32) NOTE: The AWS SDK for JavaScript (v2) is in maintenance mode.
 SDK releases are limited to address critical bug fixes and security issues only.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the blog post at https://a.co/cUPnyil
(Use `node --trace-warnings ...` to show where the warning was created)
[I 2024-11-03 15:10:43.194 ServerApp] notebook | extension was successfully linked.
[15:10:43.185] INFO (32): Server is running on port 8080
INFO:root:Migrations done
INFO:root:Setup finished
2024-11-03 15:10:43,231 INFO exited: setup (exit status 0; expected)
[15:10:43.374] ERROR (32): Failed to update schedule
    module: "schedule"
    err: {
      "type": "PrismaClientKnownRequestError",
      "message": "\nInvalid `prisma.executionSchedule.findMany()` invocation:\n\n\nThe table `public.ExecutionSchedule` does not exist in the current database.",
      "stack":
          PrismaClientKnownRequestError: 
          Invalid `prisma.executionSchedule.findMany()` invocation:
          
          
          The table `public.ExecutionSchedule` does not exist in the current database.
              at Mn.handleRequestError (/app/api/node_modules/@prisma/client/runtime/library.js:121:7753)
              at Mn.handleAndLogRequestError (/app/api/node_modules/@prisma/client/runtime/library.js:121:7061)
              at Mn.request (/app/api/node_modules/@prisma/client/runtime/library.js:121:6745)
              at async l (/app/api/node_modules/@prisma/client/runtime/library.js:130:9633)
      "name": "PrismaClientKnownRequestError",
      "code": "P2021",
      "clientVersion": "5.21.0",
      "meta": {
        "modelName": "ExecutionSchedule",
        "table": "public.ExecutionSchedule"
      }
    }
Waiting for Web and API services to be reachable...

It seems that the environment variable configuration might not be taking effect.

@superstring
Copy link
Author

run with quick-start command is also fail:

 docker run -d \
   -p 3000:3000 \
   -v briefer_psql_data:/var/lib/postgresql/data \
   -v briefer_jupyter_data:/home/jupyteruser \
   -v briefer_briefer_data:/home/briefer \
   briefercloud/briefer
INFO:root:Waiting for setup to finish
2024-11-03 15:25:00,633 INFO success: postgres entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-11-03 15:25:00,634 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO:root:Waiting for setup to finish
INFO:root:Waiting for setup to finish
INFO:root:Waiting for setup to finish
Prisma schema loaded from packages/database/prisma/schema.prisma
Datasource "db": PostgreSQL database "briefer", schema "public" at "localhost:5432"

19 migrations found in prisma/migrations

INFO:root:Waiting for setup to finish
INFO:root:Waiting for setup to finish
2024-11-03 15:25:01.284 UTC [189] ERROR:  permission denied for table _prisma_migrations
2024-11-03 15:25:01.284 UTC [189] STATEMENT:  SELECT "id", "checksum", "finished_at", "migration_name", "logs", "rolled_back_at", "started_at", "applied_steps_count" FROM "_prisma_migrations" ORDER BY "started_at" ASC
Error: ERROR: permission denied for table _prisma_migrations
   0: schema_core::state::ApplyMigrations
             at schema-engine/core/src/state.rs:226

Traceback (most recent call last):
  File "/app/setup/setup.py", line 154, in <module>
2024-11-03 15:25:01,318 INFO reaped unknown pid 154 (terminated by SIGTERM)
    main()
  File "/app/setup/setup.py", line 145, in main
    setup_apps()
  File "/app/setup/setup.py", line 90, in setup_apps
    run_migrations(cfg)
  File "/app/setup/setup.py", line 128, in run_migrations
    migrations.check_returncode()
  File "/usr/lib/python3.11/subprocess.py", line 502, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['npx', 'prisma', 'migrate', 'deploy', '--schema', 'packages/database/prisma/schema.prisma']' returned non-zero exit status 1.
2024-11-03 15:25:01,341 WARN exited: setup (exit status 1; not expected)
Waiting for Web and API services to be reachable...
INFO:root:Waiting for setup to finish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant