[GH-ISSUE #1398] Error on site deletion #8655

Closed
opened 2026-04-30 04:39:34 -05:00 by GiteaMirror · 8 comments
Owner

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:

Image

Many thanks!

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: <img width="1904" height="181" alt="Image" src="https://github.com/user-attachments/assets/68c5241d-d2f1-47d4-bd67-e4bc99d2fe2c" /> Many thanks!
Author
Owner

@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.

<!-- gh-comment-id:3245696303 --> @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.
Author
Owner

@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!

<!-- gh-comment-id:3245714870 --> @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!
Author
Owner

@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!

<!-- gh-comment-id:3246156371 --> @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!
Author
Owner

@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

<!-- gh-comment-id:3246484452 --> @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`
Author
Owner

@tayvermtos commented on GitHub (Sep 2, 2025):

4869-8e44405bcc0f1a7d.js:1 Warning: Missing Descriptionoraria-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

<!-- gh-comment-id:3246564222 --> @tayvermtos commented on GitHub (Sep 2, 2025): `4869-8e44405bcc0f1a7d.js:1 Warning: Missing `Description` or `aria-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 `
Author
Owner

@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 KEY

The quickest way to check is:

  • Go to the client/role/user that was connected to this site and see if it still shows up there.
  • If it does, try removing the site from that place first, then delete it again.
<!-- gh-comment-id:3246574082 --> @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 KEY` The quickest way to check is: - Go to the client/role/user that was connected to this site and see if it still shows up there. - If it does, try removing the site from that place first, then delete it again.
Author
Owner

@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!

<!-- gh-comment-id:3246788046 --> @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!
Author
Owner

@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!

<!-- gh-comment-id:3246791642 --> @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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#8655