I think this causes the following command (to create an Org thru the API), to fail as well. The error message is a little vague however, so it could be anything.
VPS: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org, in 0.19 seconds) VPS: {"data":null,"success":false,"error":true,"message":"An error occurred","status":500,"stack":null}
Am i doing something wrong here?
Originally created by @jackrosenberg on GitHub (Aug 16, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1287
I am in the proccess of making an automated test for pangolin (NixOS) and am running into some trouble.
`pangctl set-admin-credentials --email "admin@example.test" --password "Password123!"`
results in:
```
VPS # [ 7.669059] pangolin[886]: Running migrations...
VPS # [ 7.719349] pangolin[886]: Migrations completed successfully.
VPS # Failed to set admin credentials SqliteError: no such table: user
VPS # at Database.prepare (...-pangolin-1.8.0/share/pangolin/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
VPS # at BetterSQLiteSession.prepareQuery (...pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/better-sqlite3/session.js:23:30)
VPS # at BetterSQLiteSession.prepareOneTimeQuery (file:///nix/store/kqsg160ml3w59fka2q4b1l95gzyicc1w-pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:142:17)
VPS # at SQLiteSelectBase._prepare (...-pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:615:88)
VPS # at SQLiteSelectBase.all (...-pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:641:17)
VPS # at SQLiteSelectBase.execute (...-pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:650:17)
VPS # at SQLiteSelectBase.then (...-pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/query-promise.js:21:17) {
VPS # code: 'SQLITE_ERROR'
VPS # }
VPS # Error: TransactionRollbackError [DrizzleError]: Rollback
VPS # at BetterSQLiteTransaction.rollback (...-pangolin-1.8.0/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:198:11)
VPS # at Function.<anonymous> (...-pangolin-1.8.0/share/pangolin/dist/cli.mjs:17:1220)
VPS # at async Object.handler (...-pangolin-1.8.0/share/pangolin/dist/cli.mjs:17:518) {
VPS # cause: undefined
VPS # }
```
Which seems pretty clear, `user` does not exist. However, running `sqlite3 /var/lib/pangolin/config/db/db.sqlite` `.tables` gives:
```
__drizzle_migrations newtSession session
actions olms sites
apiKeyActions orgDomains supporterKey
apiKeyOrg orgs targets
apiKeys passwordResetTokens twoFactorBackupCodes
clientSession resourceAccessToken user <---
clientSites resourceOtp userActions
clients resourcePassword userClients
domains resourcePincode userDomains
emailVerificationCodes resourceRules userInvites
exitNodes resourceSessions userOrgs
hostMeta resourceWhitelist userResources
idp resources userSites
idpOidcConfig roleActions versionMigrations
idpOrg roleClients webauthnChallenge
licenseKey roleResources webauthnCredentials
limits roleSites
newt roles
```
I think this causes the following command (to create an Org thru the API), to fail as well. The error message is a little vague however, so it could be anything.
`VPS: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org, in 0.19 seconds)`
`VPS: {"data":null,"success":false,"error":true,"message":"An error occurred","status":500,"stack":null}`
Am i doing something wrong here?
@oschwartz10612 commented on GitHub (Aug 16, 2025):
It feels like it is not running the migrations before you run the cli
command. But
Running migrations...
It does seem to be doing that?
What is your order of operations? I suppose you are running Pangolin
container then running the cli command or are you running the cli
command before properly starting the container. Wondering if that could
be the cause?
<!-- gh-comment-id:3193803379 -->
@oschwartz10612 commented on GitHub (Aug 16, 2025):
It feels like it is not running the migrations before you run the cli
command. But
> Running migrations...
It does seem to be doing that?
What is your order of operations? I suppose you are running Pangolin
container then running the cli command or are you running the cli
command before properly starting the container. Wondering if that could
be the cause?
@jackrosenberg commented on GitHub (Aug 16, 2025):
The cli command only runs after the pangolin service is online. I checked the __drizzle_migrations table as well, and it wasn't empty, which leads me to believe the migrating were run
<!-- gh-comment-id:3193804903 -->
@jackrosenberg commented on GitHub (Aug 16, 2025):
The cli command only runs after the pangolin service is online. I checked the `__drizzle_migrations` table as well, and it wasn't empty, which leads me to believe the migrating were run
@jackrosenberg commented on GitHub (Aug 17, 2025):
VPS # [ 10.449537] pangolin[862]: 2025-08-17T10:43:38.229Z [error]: Unhandled Rejection: {"reason":{}}
VPS # [ 10.455984] pangolin[862]: ⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
VPS # [ 10.457186] pangolin[862]: at t (.next/server/webpack-runtime.js:1:143)
VPS # [ 10.457912] pangolin[862]: at t.t (.next/server/webpack-runtime.js:1:431)
VPS # [ 10.458632] pangolin[862]: 2025-08-17T10:43:38.235Z [error]: Unhandled Rejection: {"reason":{}}
VPS # [ 10.459592] pangolin[862]: ⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
VPS # [ 10.460684] pangolin[862]: at Function.t (.next/server/webpack-runtime.js:1:143)
VPS # [ 10.811304] gerbil[863]: INFO: 2025/08/17 10:43:38 Fetching remote config from http://localhost:3001/api/v1/gerbil/get-config
VPS # [ 10.855313] pangolin[862]: 2025-08-17T10:43:38.635Z [info]: Created new exit node Exit Node cjz9FXvu with address 100.89.128.1/24 and port 51820
This may also be part of the issue, since I only get this while running in the testing VM...
<!-- gh-comment-id:3194306884 -->
@jackrosenberg commented on GitHub (Aug 17, 2025):
```
VPS # [ 10.449537] pangolin[862]: 2025-08-17T10:43:38.229Z [error]: Unhandled Rejection: {"reason":{}}
VPS # [ 10.455984] pangolin[862]: ⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
VPS # [ 10.457186] pangolin[862]: at t (.next/server/webpack-runtime.js:1:143)
VPS # [ 10.457912] pangolin[862]: at t.t (.next/server/webpack-runtime.js:1:431)
VPS # [ 10.458632] pangolin[862]: 2025-08-17T10:43:38.235Z [error]: Unhandled Rejection: {"reason":{}}
VPS # [ 10.459592] pangolin[862]: ⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
VPS # [ 10.460684] pangolin[862]: at Function.t (.next/server/webpack-runtime.js:1:143)
VPS # [ 10.811304] gerbil[863]: INFO: 2025/08/17 10:43:38 Fetching remote config from http://localhost:3001/api/v1/gerbil/get-config
VPS # [ 10.855313] pangolin[862]: 2025-08-17T10:43:38.635Z [info]: Created new exit node Exit Node cjz9FXvu with address 100.89.128.1/24 and port 51820
```
This may also be part of the issue, since I only get this while running in the testing VM...
@oschwartz10612 commented on GitHub (Aug 31, 2025):
Sorry for the delay? Is this at all different on 1.9.2 - we do have the
setup token thing now.
<!-- gh-comment-id:3239712407 -->
@oschwartz10612 commented on GitHub (Aug 31, 2025):
Sorry for the delay? Is this at all different on 1.9.2 - we do have the
setup token thing now.
@SigmaSquadron commented on GitHub (Aug 31, 2025):
The setup token still requires you to open an HTML page and log-in interactively. We're setting up automated OS-level tests for the entire Pangolin stack, which means we need some way to interact with Pangolin without using a web browser. API keys are perfect for that, but we cannot generate them without first logging in.
<!-- gh-comment-id:3239854305 -->
@SigmaSquadron commented on GitHub (Aug 31, 2025):
The setup token still requires you to open an HTML page and log-in interactively. We're setting up automated OS-level tests for the entire Pangolin stack, which means we need some way to interact with Pangolin without using a web browser. API keys are perfect for that, but we cannot generate them without first logging in.
@jackrosenberg commented on GitHub (Aug 31, 2025):
We've gone through a couple iterations now, and are still running into some problems. The general flow is this:
On the VPS:
Insert API key into the DB
Create an org
Create a site
On the privateHost
Run newt
Step 4 is failing.
A 400 is quite ambiguous, do you have any idea where this error is coming from @oschwartz10612 ?
<!-- gh-comment-id:3240068098 -->
@jackrosenberg commented on GitHub (Aug 31, 2025):
We've gone through a couple iterations now, and are still running into some problems. The general flow is this:
On the VPS:
1. Insert API key into the DB
2. Create an org
3. Create a site
<img width="819" height="120" alt="Image" src="https://github.com/user-attachments/assets/7fd6b3da-235b-4ede-a471-5963846e0d84" />
On the privateHost
4. Run newt
Step 4 is failing.
<img width="1028" height="118" alt="Image" src="https://github.com/user-attachments/assets/0d2498eb-02fa-43a2-b9e9-8550c6bded13" />
A 400 is quite ambiguous, do you have any idea where this error is coming from @oschwartz10612 ?
@jackrosenberg commented on GitHub (Aug 31, 2025):
I tested this with my existing pangolin install, and it connects. This leads me to believe that somewhere along the way we are missing database inserts/ something similar. Could you provide me a flow of either database inserts or api calls that are needed for everything to work?
<!-- gh-comment-id:3240213367 -->
@jackrosenberg commented on GitHub (Aug 31, 2025):
I tested this with my existing pangolin install, and it connects. This leads me to believe that somewhere along the way we are missing database inserts/ something similar. Could you provide me a flow of either database inserts or api calls that are needed for everything to work?
@oschwartz10612 commented on GitHub (Sep 1, 2025):
Yeah I get it! Setup token makes this harder. Maybe we can get a PR
together to create the admin user in the cli with a different command?
On the site thing: are you creating the newt? There needs to be an entry
in the newt table with the hashed secret which is kind of hard to do in
pure sqlite.
How are you with TS? Ill accept any PRs you want into the CLI to create
sites and newts and stuff if you would like. I can also help with them
if you would like. I think we would want to have a create newt one
because you need to do that hash step before its inserted into the db.
Loving all of the work you are doing on this. Once you get it to work if
you want to make some sort of test suite in a github action we could run
as a integration test that would be the coolest thing! :}
<!-- gh-comment-id:3240826888 -->
@oschwartz10612 commented on GitHub (Sep 1, 2025):
Yeah I get it! Setup token makes this harder. Maybe we can get a PR
together to create the admin user in the cli with a different command?
On the site thing: are you creating the newt? There needs to be an entry
in the newt table with the hashed secret which is kind of hard to do in
pure sqlite.
How are you with TS? Ill accept any PRs you want into the CLI to create
sites and newts and stuff if you would like. I can also help with them
if you would like. I think we would want to have a create newt one
because you need to do that hash step before its inserted into the db.
Loving all of the work you are doing on this. Once you get it to work if
you want to make some sort of test suite in a github action we could run
as a integration test that would be the coolest thing! :}
Maybe we can get a PR
together to create the admin user in the cli with a different command?
Yea honestly this sounds like the best approach.
On the site thing: are you creating the newt? There needs to be an entry
in the newt table with the hashed secret which is kind of hard to do in
pure sqlite.
I'm inserting the API key, and adding permissions to it via sql, then creating an org and site via the API.
How are you with TS? Ill accept any PRs you want into the CLI to create
sites and newts and stuff if you would like. I can also help with them
if you would like. I think we would want to have a create newt one
because you need to do that hash step before its inserted into the db.
Hahah damn, i got around that hash step by just using my actual (old) admin API key ;). I agree doing it the proper way is more elegant. I'll try and cook something up :)
Loving all of the work you are doing on this.
Thanks :) @SigmaSquadron too! You guys are making some very cool software.
Once you get it to work if you want to make some sort of test suite in a github action we could run
as a integration test that would be the coolest thing! :}
Sure! I'll need to do some homework to see exactly how NixOS does that, but the tests are all yours if you want them! Link to the current NixOS PR, the testing flow is somewhat explained there. (nixos/tests/pangolin.nix)
<!-- gh-comment-id:3241484255 -->
@jackrosenberg commented on GitHub (Sep 1, 2025):
> Maybe we can get a PR
> together to create the admin user in the cli with a different command?
Yea honestly this sounds like the best approach.
> On the site thing: are you creating the newt? There needs to be an entry
> in the newt table with the hashed secret which is kind of hard to do in
> pure sqlite.
I'm inserting the API key, and adding permissions to it via sql, then creating an org and site via the API.
```
curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org
```
```
curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"address":"100.90.128.0","exitNodeId":1,"name":"test_site","newtId":"this.is.the.newt.id","pubKey":"this.is.the.public.key","secret":"1234567890","subnet":"100.90.128.0/24","type":"newt"}' --url http://localhost:3004/v1/org/test/site
```
> How are you with TS? Ill accept any PRs you want into the CLI to create
> sites and newts and stuff if you would like. I can also help with them
> if you would like. I think we would want to have a create newt one
> because you need to do that hash step before its inserted into the db.
Hahah damn, i got around that hash step by just using my actual (old) admin API key ;). I agree doing it the proper way is more elegant. I'll try and cook something up :)
> Loving all of the work you are doing on this.
Thanks :) @SigmaSquadron too! You guys are making some very cool software.
> Once you get it to work if you want to make some sort of test suite in a github action we could run
> as a integration test that would be the coolest thing! :}
Sure! I'll need to do some homework to see exactly how NixOS does that, but the tests are all yours if you want them! [Link](https://github.com/NixOS/nixpkgs/pull/416148) to the current NixOS PR, the testing flow is somewhat explained there. (nixos/tests/pangolin.nix)
@oschwartz10612 commented on GitHub (Sep 1, 2025):
I'm inserting the API key, and adding permissions to it via sql, then
creating an org and site via the API.
Hum this should be hashing it into the DB I think then. The API route
does this as a mater of creating the newt. I just wanted to make sure
you were not just creating them with sql. I would expect the hashing to
not be a problem here... You should see what looks like a crypto hash of
the secret in the newt table.
Thinking about it more - 400 is a bad request error. Pangolin probably
does not like something. Try newt in debug mode if not already it MAY
print out the actual error from pangolin - if not this is a long
standing issue I have needed to fix to get it to actually tell you the
response. Are there any logs in pangolin about why 400?
Thanks :) @SigmaSquadron https://github.com/SigmaSquadron too! You
guys are making some very cool software. Just dont sell out ;)
Love it great @SigmaSquadron! Yeah the plan is to follow something like
Grafana's model as much as possible.
<!-- gh-comment-id:3242958694 -->
@oschwartz10612 commented on GitHub (Sep 1, 2025):
> I'm inserting the API key, and adding permissions to it via sql, then
> creating an org and site via the API.
Hum this should be hashing it into the DB I think then. The API route
does this as a mater of creating the newt. I just wanted to make sure
you were not just creating them with sql. I would expect the hashing to
not be a problem here... You should see what looks like a crypto hash of
the secret in the newt table.
Thinking about it more - 400 is a bad request error. Pangolin probably
does not like something. Try newt in debug mode if not already it MAY
print out the actual error from pangolin - if not this is a long
standing issue I have needed to fix to get it to actually tell you the
response. Are there any logs in pangolin about why 400?
> Thanks :) @SigmaSquadron <https://github.com/SigmaSquadron> too! You
> guys are making some very cool software. Just dont sell out ;)
Love it great @SigmaSquadron! Yeah the plan is to follow something like
Grafana's model as much as possible.
These are the logs from pangolin, nothing else on the rest of the stack:
2025-09-01T18:35:56.735Z [info]: Started offline checker interval
2025-09-01T18:35:56.740Z [warn]: Email SMTP configuration is missing. Emails will not be sent.
=== SETUP TOKEN GENERATED ===
Token: iarqzy4jivf3ie7g2zgyohh5puwdqxse
Use this token on the initial setup page
================================
2025-09-01T18:35:56.910Z [info]: Pangolin now gathers anonymous usage data to help us better understand how the software is used and guide future improvements and feature development. You can find more details, including instructions for opting out of this anonymous data collection, at: https://docs.digpangolin.com/telemetry
2025-09-01T18:35:57.313Z [info]: API server is running on http://localhost:3000
2025-09-01T18:35:57.315Z [info]: Internal server is running on http://localhost:3001
2025-09-01T18:35:57.966Z [info]: Next.js server is running on http://localhost:3002
2025-09-01T18:35:57.969Z [info]: Integration API server is running on http://localhost:3004
2025-09-01T18:35:57.971Z [error]: Unhandled Rejection: {"reason":{}}
TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 16793 (.next/server/app/[orgId]/settings/general/page.js:1:595)
at c (.next/server/webpack-runtime.js:1:143)
at 66387 (.next/server/app/[orgId]/settings/general/page.js:2:12407)
at Function.c (.next/server/webpack-runtime.js:1:143)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 16793 (.next/server/app/[orgId]/settings/general/page.js:1:595)
at c (.next/server/webpack-runtime.js:1:143)
at 66387 (.next/server/app/[orgId]/settings/general/page.js:2:12407)
at Function.c (.next/server/webpack-runtime.js:1:143)
2025-09-01T18:35:57.988Z [error]: Unhandled Rejection: {"reason":{}}
TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 78304 (.next/server/app/[orgId]/settings/access/users/page.js:2:9490)
at c (.next/server/webpack-runtime.js:1:143)
at 99692 (.next/server/app/[orgId]/settings/access/roles/page.js:2:16721)
at Function.c (.next/server/webpack-runtime.js:1:143)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 78304 (.next/server/app/[orgId]/settings/access/users/page.js:2:9490)
at c (.next/server/webpack-runtime.js:1:143)
at 99692 (.next/server/app/[orgId]/settings/access/roles/page.js:2:16721)
at Function.c (.next/server/webpack-runtime.js:1:143)
2025-09-01T18:35:58.001Z [error]: Unhandled Rejection: {"reason":{}}
TypeError: Cannot read properties of undefined (reading 'call')
at Function.c (.next/server/webpack-runtime.js:1:143)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
at Function.c (.next/server/webpack-runtime.js:1:143)
2025-09-01T18:35:58.474Z [info]: Created new exit node Exit Node 2HpRrkCe with address 100.89.128.1/24 and port 51820
Error while flushing PostHog [Error [PostHogFetchNetworkError]: Network error while fetching PostHog] {
error: [TypeError: fetch failed] {
[cause]: [Error: self-signed certificate] { code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }
},
[cause]: [TypeError: fetch failed] {
[cause]: [Error: self-signed certificate] { code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }
}
}
nixos: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org
2025-09-01T18:36:01.608Z [error]: Rollback
Stack: DrizzleError: Rollback
at BetterSQLiteTransaction.rollback (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:197:11)
at Function.<anonymous> (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/server.mjs:28:21774)
at async Ba (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/server.mjs:28:20841) {"name":"DrizzleError"}
nixos: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org, in 0.12 seconds)
nixos: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"address":"100.90.128.0","exitNodeId":1,"name":"test_site","newtId":"newtId","pubKey":"pubKey","secret":"1234567890","subnet":"100.90.128.0/24","type":"newt"}' --url http://localhost:3004/v1/org/test/site
nixos: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"address":"100.90.128.0","exitNodeId":1,"name":"test_site","newtId":"newtId","pubKey":"pubKey","secret":"1234567890","subnet":"100.90.128.0/24","type":"newt"}' --url http://localhost:3004/v1/org/test/site, in 0.12 seconds)
<!-- gh-comment-id:3243092757 -->
@jackrosenberg commented on GitHub (Sep 1, 2025):
The following yields:
`$ sqlite3 /var/lib/pangolin/config/db/db.sqlite 'select * from orgs; select * from newt; select * from sites'`
```
test|test|100.90.128.0/24|2025-09-01T18:25:23.768Z
this.is.the.newt.id|$argon2id$v=19$m=19456,t=2,p=1$9U2xzvjKrMokD2yqHDae4g$uUa6yC6bafM7TWvgYR8yUL3hxzZ1ZaUt2Y2Il/zT4pU|2025-09-01T18:25:23.918Z||1
1|test|blaring-european-ground-squirrel|1|test_site||100.90.128.0/24|0|0||newt|0|100.90.128.0/24|||||1|
```
These are the logs from pangolin, nothing else on the rest of the stack:
```
2025-09-01T18:35:56.735Z [info]: Started offline checker interval
2025-09-01T18:35:56.740Z [warn]: Email SMTP configuration is missing. Emails will not be sent.
=== SETUP TOKEN GENERATED ===
Token: iarqzy4jivf3ie7g2zgyohh5puwdqxse
Use this token on the initial setup page
================================
2025-09-01T18:35:56.910Z [info]: Pangolin now gathers anonymous usage data to help us better understand how the software is used and guide future improvements and feature development. You can find more details, including instructions for opting out of this anonymous data collection, at: https://docs.digpangolin.com/telemetry
2025-09-01T18:35:57.313Z [info]: API server is running on http://localhost:3000
2025-09-01T18:35:57.315Z [info]: Internal server is running on http://localhost:3001
2025-09-01T18:35:57.966Z [info]: Next.js server is running on http://localhost:3002
2025-09-01T18:35:57.969Z [info]: Integration API server is running on http://localhost:3004
2025-09-01T18:35:57.971Z [error]: Unhandled Rejection: {"reason":{}}
TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 16793 (.next/server/app/[orgId]/settings/general/page.js:1:595)
at c (.next/server/webpack-runtime.js:1:143)
at 66387 (.next/server/app/[orgId]/settings/general/page.js:2:12407)
at Function.c (.next/server/webpack-runtime.js:1:143)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 16793 (.next/server/app/[orgId]/settings/general/page.js:1:595)
at c (.next/server/webpack-runtime.js:1:143)
at 66387 (.next/server/app/[orgId]/settings/general/page.js:2:12407)
at Function.c (.next/server/webpack-runtime.js:1:143)
2025-09-01T18:35:57.988Z [error]: Unhandled Rejection: {"reason":{}}
TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 78304 (.next/server/app/[orgId]/settings/access/users/page.js:2:9490)
at c (.next/server/webpack-runtime.js:1:143)
at 99692 (.next/server/app/[orgId]/settings/access/roles/page.js:2:16721)
at Function.c (.next/server/webpack-runtime.js:1:143)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
at c (.next/server/webpack-runtime.js:1:143)
at 78304 (.next/server/app/[orgId]/settings/access/users/page.js:2:9490)
at c (.next/server/webpack-runtime.js:1:143)
at 99692 (.next/server/app/[orgId]/settings/access/roles/page.js:2:16721)
at Function.c (.next/server/webpack-runtime.js:1:143)
2025-09-01T18:35:58.001Z [error]: Unhandled Rejection: {"reason":{}}
TypeError: Cannot read properties of undefined (reading 'call')
at Function.c (.next/server/webpack-runtime.js:1:143)
⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'call')
at Function.c (.next/server/webpack-runtime.js:1:143)
2025-09-01T18:35:58.474Z [info]: Created new exit node Exit Node 2HpRrkCe with address 100.89.128.1/24 and port 51820
Error while flushing PostHog [Error [PostHogFetchNetworkError]: Network error while fetching PostHog] {
error: [TypeError: fetch failed] {
[cause]: [Error: self-signed certificate] { code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }
},
[cause]: [TypeError: fetch failed] {
[cause]: [Error: self-signed certificate] { code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }
}
}
nixos: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org
2025-09-01T18:36:01.608Z [error]: Rollback
Stack: DrizzleError: Rollback
at BetterSQLiteTransaction.rollback (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:197:11)
at Function.<anonymous> (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/server.mjs:28:21774)
at async Ba (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/server.mjs:28:20841) {"name":"DrizzleError"}
nixos: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org, in 0.12 seconds)
nixos: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"address":"100.90.128.0","exitNodeId":1,"name":"test_site","newtId":"newtId","pubKey":"pubKey","secret":"1234567890","subnet":"100.90.128.0/24","type":"newt"}' --url http://localhost:3004/v1/org/test/site
nixos: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"address":"100.90.128.0","exitNodeId":1,"name":"test_site","newtId":"newtId","pubKey":"pubKey","secret":"1234567890","subnet":"100.90.128.0/24","type":"newt"}' --url http://localhost:3004/v1/org/test/site, in 0.12 seconds)
```
nixos: must succeed: pangctl set-admin-credentials --email "admin@example.test" --password "Password123!"
Failed to set admin credentials SqliteError: no such table: user
at Database.prepare (/nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at BetterSQLiteSession.prepareQuery (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/better-sqlite3/session.js:23:30)
at BetterSQLiteSession.prepareOneTimeQuery (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:141:17)
at SQLiteSelectBase._prepare (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:615:88)
at SQLiteSelectBase.all (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:641:17)
at SQLiteSelectBase.execute (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:650:17)
at SQLiteSelectBase.then (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/query-promise.js:21:17) {
code: 'SQLITE_ERROR'
}
Error: TransactionRollbackError [DrizzleError]: Rollback
at BetterSQLiteTransaction.rollback (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:197:11)
at Function.<anonymous> (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/cli.mjs:17:1253)
at async Object.handler (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/cli.mjs:17:551) {
cause: undefined
}
<!-- gh-comment-id:3257559617 -->
@jackrosenberg commented on GitHub (Sep 5, 2025):
Additionally,
`"pangctl set-admin-credentials --email \"admin@example.test\" --password \"Password123!\"")`
results in:
```
nixos: must succeed: pangctl set-admin-credentials --email "admin@example.test" --password "Password123!"
Failed to set admin credentials SqliteError: no such table: user
at Database.prepare (/nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at BetterSQLiteSession.prepareQuery (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/better-sqlite3/session.js:23:30)
at BetterSQLiteSession.prepareOneTimeQuery (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:141:17)
at SQLiteSelectBase._prepare (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:615:88)
at SQLiteSelectBase.all (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:641:17)
at SQLiteSelectBase.execute (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/query-builders/select.js:650:17)
at SQLiteSelectBase.then (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/query-promise.js:21:17) {
code: 'SQLITE_ERROR'
}
Error: TransactionRollbackError [DrizzleError]: Rollback
at BetterSQLiteTransaction.rollback (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/node_modules/drizzle-orm/sqlite-core/session.js:197:11)
at Function.<anonymous> (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/cli.mjs:17:1253)
at async Object.handler (file:///nix/store/km04n8f1jrcdmhznw0gbyld2kgixrsbi-pangolin-1.9.2/share/pangolin/dist/cli.mjs:17:551) {
cause: undefined
}
```
@github-actions[bot] commented on GitHub (Sep 24, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
<!-- gh-comment-id:3325986311 -->
@github-actions[bot] commented on GitHub (Sep 24, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
I'm jumping in late here, but maybe the CLI command is running before the migrations are complete? If you set up Pangolin manually, start it, and wait for the info logs to print that it's fully online, then run the CLI command does it work?
<!-- gh-comment-id:3342109089 -->
@miloschwartz commented on GitHub (Sep 27, 2025):
I'm jumping in late here, but maybe the CLI command is running before the migrations are complete? If you set up Pangolin manually, start it, and wait for the info logs to print that it's fully online, then run the CLI command does it work?
@github-actions[bot] commented on GitHub (Oct 12, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
<!-- gh-comment-id:3393765813 -->
@github-actions[bot] commented on GitHub (Oct 12, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@github-actions[bot] commented on GitHub (Oct 26, 2025):
This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.
<!-- gh-comment-id:3447893066 -->
@github-actions[bot] commented on GitHub (Oct 26, 2025):
This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @jackrosenberg on GitHub (Aug 16, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1287
I am in the proccess of making an automated test for pangolin (NixOS) and am running into some trouble.
pangctl set-admin-credentials --email "admin@example.test" --password "Password123!"results in:
Which seems pretty clear,
userdoes not exist. However, runningsqlite3 /var/lib/pangolin/config/db/db.sqlite.tablesgives:I think this causes the following command (to create an Org thru the API), to fail as well. The error message is a little vague however, so it could be anything.
VPS: (finished: must succeed: curl -H 'Authorization: Bearer fbon8g22m7uf8q2.mwpnq3r5ul3h5w25fskwmkvqe4eysha54admqqci' -H 'Content-Type: application/json' -H 'accept: */*' -X PUT -d '{"name":"test","orgId":"test","subnet":"100.90.128.0/24"}' --url http://localhost:3004/v1/org, in 0.19 seconds)VPS: {"data":null,"success":false,"error":true,"message":"An error occurred","status":500,"stack":null}Am i doing something wrong here?
@oschwartz10612 commented on GitHub (Aug 16, 2025):
It feels like it is not running the migrations before you run the cli
command. But
It does seem to be doing that?
What is your order of operations? I suppose you are running Pangolin
container then running the cli command or are you running the cli
command before properly starting the container. Wondering if that could
be the cause?
@jackrosenberg commented on GitHub (Aug 16, 2025):
The cli command only runs after the pangolin service is online. I checked the
__drizzle_migrationstable as well, and it wasn't empty, which leads me to believe the migrating were run@jackrosenberg commented on GitHub (Aug 17, 2025):
This may also be part of the issue, since I only get this while running in the testing VM...
@oschwartz10612 commented on GitHub (Aug 31, 2025):
Sorry for the delay? Is this at all different on 1.9.2 - we do have the
setup token thing now.
@SigmaSquadron commented on GitHub (Aug 31, 2025):
The setup token still requires you to open an HTML page and log-in interactively. We're setting up automated OS-level tests for the entire Pangolin stack, which means we need some way to interact with Pangolin without using a web browser. API keys are perfect for that, but we cannot generate them without first logging in.
@jackrosenberg commented on GitHub (Aug 31, 2025):
We've gone through a couple iterations now, and are still running into some problems. The general flow is this:
On the VPS:
On the privateHost
Step 4 is failing.
A 400 is quite ambiguous, do you have any idea where this error is coming from @oschwartz10612 ?
@jackrosenberg commented on GitHub (Aug 31, 2025):
I tested this with my existing pangolin install, and it connects. This leads me to believe that somewhere along the way we are missing database inserts/ something similar. Could you provide me a flow of either database inserts or api calls that are needed for everything to work?
@oschwartz10612 commented on GitHub (Sep 1, 2025):
Yeah I get it! Setup token makes this harder. Maybe we can get a PR
together to create the admin user in the cli with a different command?
On the site thing: are you creating the newt? There needs to be an entry
in the newt table with the hashed secret which is kind of hard to do in
pure sqlite.
How are you with TS? Ill accept any PRs you want into the CLI to create
sites and newts and stuff if you would like. I can also help with them
if you would like. I think we would want to have a create newt one
because you need to do that hash step before its inserted into the db.
Loving all of the work you are doing on this. Once you get it to work if
you want to make some sort of test suite in a github action we could run
as a integration test that would be the coolest thing! :}
@jackrosenberg commented on GitHub (Sep 1, 2025):
Yea honestly this sounds like the best approach.
I'm inserting the API key, and adding permissions to it via sql, then creating an org and site via the API.
Hahah damn, i got around that hash step by just using my actual (old) admin API key ;). I agree doing it the proper way is more elegant. I'll try and cook something up :)
Thanks :) @SigmaSquadron too! You guys are making some very cool software.
Sure! I'll need to do some homework to see exactly how NixOS does that, but the tests are all yours if you want them! Link to the current NixOS PR, the testing flow is somewhat explained there. (nixos/tests/pangolin.nix)
@oschwartz10612 commented on GitHub (Sep 1, 2025):
Hum this should be hashing it into the DB I think then. The API route
does this as a mater of creating the newt. I just wanted to make sure
you were not just creating them with sql. I would expect the hashing to
not be a problem here... You should see what looks like a crypto hash of
the secret in the newt table.
Thinking about it more - 400 is a bad request error. Pangolin probably
does not like something. Try newt in debug mode if not already it MAY
print out the actual error from pangolin - if not this is a long
standing issue I have needed to fix to get it to actually tell you the
response. Are there any logs in pangolin about why 400?
Love it great @SigmaSquadron! Yeah the plan is to follow something like
Grafana's model as much as possible.
@jackrosenberg commented on GitHub (Sep 1, 2025):
The following yields:
$ sqlite3 /var/lib/pangolin/config/db/db.sqlite 'select * from orgs; select * from newt; select * from sites'These are the logs from pangolin, nothing else on the rest of the stack:
@jackrosenberg commented on GitHub (Sep 5, 2025):
Additionally,
"pangctl set-admin-credentials --email \"admin@example.test\" --password \"Password123!\"")results in:
@jackrosenberg commented on GitHub (Sep 9, 2025):
@oschwartz10612 do you have any idea what could be causing this?
@github-actions[bot] commented on GitHub (Sep 24, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@miloschwartz commented on GitHub (Sep 27, 2025):
I'm jumping in late here, but maybe the CLI command is running before the migrations are complete? If you set up Pangolin manually, start it, and wait for the info logs to print that it's fully online, then run the CLI command does it work?
@github-actions[bot] commented on GitHub (Oct 12, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@github-actions[bot] commented on GitHub (Oct 26, 2025):
This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.