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

[BUG] Unable to delete "Bitcoin" Asset Profile from Market Data - "Oops! Something went wrong. Please try again later." #3349

Closed
karter16 opened this issue May 1, 2024 · 10 comments · Fixed by #3445
Labels
question Further information is requested

Comments

@karter16
Copy link

karter16 commented May 1, 2024

Bug Description

As part of trying to figure out why my Bitcoin asset profile stopped retrieving historical data I have deleted all activities associated with the Bitcoin asset profile and then tried to delete the asset profile. Doing so results in an error "Oops! Something went wrong. Please try again later."

Checking the XHR in the browser console shows the following response

{ "statusCode": 500, "message": "Internal server error" }

The asset profile is not deleted

To Reproduce
I am unable to prove reproduction steps given I am unable to delete the asset profile and re-add it in order to test whether this is a persistent issue.

It should be noted that I can delete other asset profiles (provided they have no activities related to them) it is just the "Bitcoin" asset profile I cannot delete.

Expected behavior

It is possible to delete the Bitcoin asset profile.

Screenshots
Screenshot 2024-05-01 at 5 56 15 PM
Screenshot 2024-05-01 at 5 56 53 PM

Logs

Environment

  • Ghostfolio Version 2.77.1
  • Self-hosted
  • Experimental Features enabled (Note I have tried with this both enabled and disabled and the issue is present in both)
  • Safari
  • MacOS

Additional context

@karter16
Copy link
Author

karter16 commented May 2, 2024

Screenshot 2024-05-02 at 6 13 58 PM

@dtslvr
Copy link
Member

dtslvr commented May 2, 2024

Do you see anything suspicious in the server log?

@dtslvr dtslvr added the question Further information is requested label May 2, 2024
@karter16
Copy link
Author

karter16 commented May 2, 2024

Slightly off-topic but this probably explains why retrieving historical data is failing:

Screenshot 2024-05-02 at 6 19 53 PM

@karter16
Copy link
Author

karter16 commented May 2, 2024

Do you see anything suspicious in the server log?

dumb question, but what log file should I be looking in? (selfhosted, running the docker container on Debian base).

@karter16
Copy link
Author

karter16 commented May 4, 2024

sorry @dtslvr I should have tagged you in above response:

dumb question, but what log file should I be looking in? (selfhosted, running the docker container on Debian base).

@dittodhole
Copy link

same here

@karter16
Copy link
Author

same here

Ah that's interesting what you note in your bug re having selected it as a benchmark and then unselected before deleting - my situation is the same. I had Bitcoin marked as a benchmark

@gstr3745
Copy link

Do you see anything suspicious in the server log?

Since I'm experiencing the same issue, I inspected the container's log:

[Nest] 121  - 05/28/2024, 6:21:02 AM   ERROR [ExceptionsHandler]
Invalid `prisma.symbolProfile.delete()` invocation:


Foreign key constraint failed on the field: `SymbolProfileOverrides_symbolProfileId_fkey (index)`
PrismaClientKnownRequestError:
Invalid `prisma.symbolProfile.delete()` invocation:


Foreign key constraint failed on the field: `SymbolProfileOverrides_symbolProfileId_fkey (index)`
    at In.handleRequestError (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:122:6854)
    at In.handleAndLogRequestError (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:122:6188)
    at In.request (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:122:5896)
    at async l (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:127:11167)
    at async AdminService.deleteProfileData (/ghostfolio/apps/api/main.js:1:498924)
    at async /ghostfolio/apps/api/node_modules/@nestjs/core/router/router-execution-context.js:46:28
    at async /ghostfolio/apps/api/node_modules/@nestjs/core/router/router-proxy.js:9:17
    at async /ghostfolio/apps/api/node_modules/@nestjs/core/router/router-explorer.js:176:17
  

In another thread I read the advice to downgrate to 2.20.0 version, delete the entry and then upgrade to current.
I tried that, but it results in an unhealty container: I suppose it's a too old version.

(As far as I can remember, I never set the asset as a benchmark)

@dittodhole
Copy link

In another thread I read the advice to downgrate to 2.20.0 version, delete the entry and then upgrade to current. I tried that, but it results in an unhealty container: I suppose it's a too old version.

In fact, that's how I've solved it: spun up pgAdmin, and deleted the rows in MarketData, SymbolProfile, and SymbolProfileOverrides.
My instance is happy and healthy 😄

@gstr3745
Copy link

My instance is happy and healthy 😄

You cannot imagine how that record I can't delete bothers me 😆
But I have no experience in DB or programming, so I'm afraid of messing something up: I'm just pretending it doesn't exist (but deeply I know it does)

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

Successfully merging a pull request may close this issue.

4 participants