mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-06 20:59:07 -05:00
[GH-ISSUE #1398] Error on site deletion #1891
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tayvermtos on GitHub (Sep 2, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1398
Hi
I have a Site set up on a self hosted Pangolin Instance. The associated Resources have been deleted. Just this particular site throws an error on deletion. The site has been offline for a while.
I cannot replicate on any other site. Tried to rename the Site as well but hasn't helped.
Below a screenshot of the error:
Many thanks!
@Pallavikumarimdb commented on GitHub (Sep 2, 2025):
Hi @tayvermtos , Can you check if the site you’re trying to delete is a WireGuard site?
For WireGuard, it call:
deletePeer(site.exitNodeId, site.pubKey)If the peer was already removed (for example, if the site has been offline for a while), this call can throw an error and stop the deletion.
@tayvermtos commented on GitHub (Sep 2, 2025):
Hi @Pallavikumarimdb
This is a NEWT site. I actually only use NEWT sites except for one local one of the server itself.
How would I be able to check if something has already been removed?
@oschwartz10612 is this something You're aware off?
Thanks a lot!
@oschwartz10612 commented on GitHub (Sep 2, 2025):
Hi! I just tested and was not able to reproduce but does not mean this
is not an issue.
Do you think you could take a look at the Pangolin logs?
docker compose logs -f
...and look for any errors that might be there when you get the
deletion? Also looking in the browser console would be helpful!
@tayvermtos commented on GitHub (Sep 2, 2025):
@oschwartz10612
These are the logs when attempting to delete the site:
pangolin | 2025-09-02T19:07:48.956Z [error]: FOREIGN KEY constraint failed pangolin | Stack: SqliteError: FOREIGN KEY constraint failed pangolin | at PreparedQuery.run (file:///app/node_modules/drizzle-orm/better-sqlite3/session.js:72:22) pangolin | at QueryPromise.resultCb (file:///app/node_modules/drizzle-orm/sqlite-core/session.js:119:64) pangolin | at QueryPromise.execute (file:///app/node_modules/drizzle-orm/sqlite-core/session.js:13:17) pangolin | at QueryPromise.then (file:///app/node_modules/drizzle-orm/query-promise.js:21:17) pangolin | at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {"code":"SQLITE_CONSTRAINT_FOREIGNK@tayvermtos commented on GitHub (Sep 2, 2025):
4869-8e44405bcc0f1a7d.js:1 Warning: MissingDescriptionoraria-describedby={undefined}for {DialogContent}. (anonymous) @ 4869-8e44405bcc0f1a7d.js:1 o0 @ 4bd1b696-cc729d47eba2cee4.js:1 ux @ 4bd1b696-cc729d47eba2cee4.js:1 uS @ 4bd1b696-cc729d47eba2cee4.js:1 ux @ 4bd1b696-cc729d47eba2cee4.js:1 3709-d44e79904b6f871c.js:1 DELETE https://mydomain/api/v1/site/18 500 (Internal Server Error) (anonymous) @ 3709-d44e79904b6f871c.js:1 xhr @ 3709-d44e79904b6f871c.js:1 e4 @ 3709-d44e79904b6f871c.js:1 _request @ 3709-d44e79904b6f871c.js:1 request @ 3709-d44e79904b6f871c.js:1 (anonymous) @ 3709-d44e79904b6f871c.js:1 (anonymous) @ 3709-d44e79904b6f871c.js:1 onConfirm @ page-382ab9df38a2ae0c.js:1 I @ page-382ab9df38a2ae0c.js:1 push.62177.e_ @ 1089-6c16de2ffd5d475f.js:1 await in push.62177.e_ i4 @ 4bd1b696-cc729d47eba2cee4.js:1 (anonymous) @ 4bd1b696-cc729d47eba2cee4.js:1 nz @ 4bd1b696-cc729d47eba2cee4.js:1 se @ 4bd1b696-cc729d47eba2cee4.js:1 cs @ 4bd1b696-cc729d47eba2cee4.js:1 cu @ 4bd1b696-cc729d47eba2cee4.js:1 page-382ab9df38a2ae0c.js:1 Error deleting site K {message: 'Request failed with status code 500', name: 'AxiosError', code: 'ERR_BAD_RESPONSE', config: {…}, request: XMLHttpRequest, …}code: "ERR_BAD_RESPONSE"config: {transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 10000, …}message: "Request failed with status code 500"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 10000, withCredentials: false, upload: XMLHttpRequestUpload, …}response: {data: {…}, status: 500, statusText: '', headers: eT, config: {…}, …}status: 500stack: "AxiosError: Request failed with status code 500\n at eC (https://mydomain/_next/static/chunks/3709-d44e79904b6f871c.js:1:18904)\n at XMLHttpRequest.g (https://mydomain/_next/static/chunks/3709-d44e79904b6f871c.js:1:23333)\n at tn.request (https://mydomain/_next/static/chunks/3709-d44e79904b6f871c.js:1:31457)"[[Prototype]]: Errorconstructor: ƒ K(e,t,r,n,o)toJSON: ƒ ()isAxiosError: true[[Prototype]]: Object (anonymous) @ page-382ab9df38a2ae0c.js:1 Promise.catch onConfirm @ page-382ab9df38a2ae0c.js:1 I @ page-382ab9df38a2ae0c.js:1 push.62177.e_ @ 1089-6c16de2ffd5d475f.js:1 await in push.62177.e_ i4 @ 4bd1b696-cc729d47eba2cee4.js:1 (anonymous) @ 4bd1b696-cc729d47eba2cee4.js:1 nz @ 4bd1b696-cc729d47eba2cee4.js:1 se @ 4bd1b696-cc729d47eba2cee4.js:1 cs @ 4bd1b696-cc729d47eba2cee4.js:1 cu @ 4bd1b696-cc729d47eba2cee4.js:1@Pallavikumarimdb commented on GitHub (Sep 2, 2025):
It looks like the error is happening because the site is still “linked” somewhere else in the system. Even if you don’t see it directly, there may still be a record saying this site belongs to a client, a role, or a user.
If that link is broken (for example, the client or user no longer exists but the system still has a note about the site), then deleting the site won’t work.
Line:
pangolin | 2025-09-02T19:07:48.956Z [error]: FOREIGN KEY constraint failed pangolin | Stack: SqliteError: FOREIGN KEYThe quickest way to check is:
@tayvermtos commented on GitHub (Sep 2, 2025):
Hi
Thanks for the hint. There was a raw UDP Source still assigned to the site which I totally forgot about. In fact the resource was disabled (toggled off). Moved that to a different site and managed to delete the site.
There is only one User and one Role on this particular instance....
Many thanks!
@oschwartz10612 commented on GitHub (Sep 2, 2025):
Thanks for the info. This should not cause the error as it should delete
the resource / target as well. Will look into this!