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

Try to run on kubernetes Bootstrap not working #768

Open
didlawowo opened this issue Oct 17, 2024 · 15 comments
Open

Try to run on kubernetes Bootstrap not working #768

didlawowo opened this issue Oct 17, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@didlawowo
Copy link

Describe the bug
i trying to run wren ai on kubernetes using my own helm chart and get error with bootstrap on engine deployment. i have based my helm chart on analysis of your kustomize.

init config.properties
/app/init.sh: line 21: can't create "/app/data"/config.properties: nonexistent directory
grep: "/app/data"/config.properties: No such file or directory
wren.experimental-enable-dynamic-fields is not set, set it to true
/app/init.sh: line 29: can't create "/app/data"/config.properties: nonexistent directory
create mdl folder
mkdir: can't create directory '"/app/data"/mdl': No such file or directory
init mdl/sample.json
/app/init.sh: line 41: can't create "/app/data"/mdl/sample.json: nonexistent directory
init accounts file
/app/init.sh: line 49: can't create "/app/data"/accounts: nonexistent directory
Stream closed EOF for wren/wren-engine-678cf74cf9-8pdwf (bootstrap)

To Reproduce

just install init container

    initContainers:
    - name: bootstrap
      image: ghcr.io/canner/wren-bootstrap:0.1.4
      env:
      - name: DATA_PATH
        valueFrom:
          configMapKeyRef:
            name: wren
            key: WREN_ENGINE_DATA_PATH
      - name: PG_PASSWORD
        valueFrom:
          secretKeyRef:
            name: wren-postgresql
            key: postgres-password
      - name: PG_USERNAME
        valueFrom:
          secretKeyRef:
            name: wren
            key: PG_USERNAME
      volumeMounts:
      - name: wren-data
        mountPath: /app/data
      command: ["/bin/sh", "/app/init.sh"]

Expected behavior
mount working and create file

Additional context

i can provide my helm chart on discord.

@didlawowo didlawowo added the bug Something isn't working label Oct 17, 2024
@wwwy3y3
Copy link
Member

wwwy3y3 commented Oct 18, 2024

@didlawowo

As I checked the logs you provided, it's strange the path consists of quotes: "/app/data"/accounts.

Could you confirm the env value you set is correct?

@didlawowo
Copy link
Author

i think i have found it's a problem with the configmap , i 'm going to check :)

@didlawowo
Copy link
Author

i have another with the UI

Using SQLite
Batch 1 run: 15 migrations
  ▲ Next.js 13.5.6
  - Local:        http://localhost:3000
  - Network:      http://0.0.0.0:3000

 ✓ Ready in 2.2s
[2024-10-19T18:57:07.913] [INFO] TELEMETRY - Telemetry not enabled.
using pg
[2024-10-19T18:57:08.328] [INFO] AskingService - Background tracker started
Error: connect ECONNREFUSED 127.0.0.1:5432
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 5432
}
Error: connect ECONNREFUSED 127.0.0.1:5432
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 5432
}
Stream closed EOF for wren/wren-frontend-56f45d479b-kdrv2 (frontend)

@wwwy3y3
Copy link
Member

wwwy3y3 commented Oct 21, 2024

Connection issue with postgres. Don't forget to set PG_URL in wren-ui

@didlawowo
Copy link
Author

didlawowo commented Oct 21, 2024

thx now next problem

Batch 1 run: 15 migrations
  ▲ Next.js 13.5.6
  - Local:        http://localhost:3000
  - Network:      http://0.0.0.0:3000

 ✓ Ready in 2.2s
[2024-10-21T06:12:58.207] [INFO] TELEMETRY - Telemetry not enabled.
using pg
[2024-10-21T06:12:58.707] [INFO] AskingService - Background tracker started
error: select * from "thread_response" - relation "thread_response" does not exist
    at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 114,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '15',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1449',
  routine: 'parserOpenTable'
}

the database admin_ui is empty.
where is the job who init it ?

@onlyjackfrost
Copy link
Contributor

Batch 1 run: 15 migrations Did the migration succeed?
We run migrations before starting server.

CMD knex migrate:latest && HOSTNAME="0.0.0.0" node server.js

@didlawowo
Copy link
Author

didlawowo commented Oct 22, 2024

Batch 1 run: 15 migrations Did the migration succeed? We run migrations before starting server.

CMD knex migrate:latest && HOSTNAME="0.0.0.0" node server.js

the migration seems working if your look at the log

Using SQLite
Batch 1 run: 15 migrations
  ▲ Next.js 13.5.6
  - Local:        http://localhost:3000
  - Network:      http://0.0.0.0:3000

 ✓ Ready in 2.4s

@wwwy3y3
Copy link
Member

wwwy3y3 commented Oct 22, 2024

@didlawowo the logs (Using SQLite) show that it's connecting to SQLite, not Postgres.

Could you show us the logs of wren-ui after you setup PG_URL ?

Also, make sure that the postgres user has enough permission to do the database migration.

@didlawowo
Copy link
Author

on my side, i don't have config for sqlite,

inside the container:

/app # env | grep sql
PG_URL=postgres://wren:postgres@wren-postgresql:5432/admin_ui
/app # env | grep lite

@didlawowo
Copy link
Author

if you set DB_TYPE=pg (insteand of WREN_UI_DB_TYPE) it's work
but then i have a probleme when i try to create connection to database in ui
(if connection fail i have another message)

Unexpected token o in JSON at position 1

@didlawowo
Copy link
Author

@wwwy3y3

@wwwy3y3
Copy link
Member

wwwy3y3 commented Oct 24, 2024

@didlawowo could you share your logs to us ?

@didlawowo
Copy link
Author

image

@didlawowo
Copy link
Author

didlawowo commented Oct 24, 2024

and nothing in the logs
@wwwy3y3

@wwwy3y3
Copy link
Member

wwwy3y3 commented Oct 25, 2024

could you get logs from wren-engine & wren-ibis-server as well ?

I think there might be some issues on the network connection between services. That's why we saw response not in JSON format.

Could you also make sure the network connection from ui to engine & ibis work ? Please double-check on the following env: WREN_ENGINE_ENDPOINT , WREN_ENGINE_PORT, IBIS_SERVER_ENDPOINT. Make sure IBIS_SERVER_ENDPOINT is sth like http://wren-ibis-server:8000. It should point to the ibis service

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

3 participants