orbstack / orbstack

Fast, light, simple Docker containers & Linux machines
https://orbstack.dev
MIT License
5.6k stars 43 forks source link

Crash with "Transaction commit failed: sql: transaction has already been committed or rolled back" #758

Open denisvmedia opened 1 year ago

denisvmedia commented 1 year ago

Describe the bug

It just crashed with a window having unformatted text:

tobuf,application/json,audit-id:f1be1d5f-5244-4c4c-89fa-445cb56f7088,client:127.0.0.1,protocol:HTTP/2.0,resource:persistentvolumes,scope:resource,url:/api/v1/persistentvolumes/pvc-3fa070ca-7252-4302-abe9-639920916962,user-agent:k3s/v1.27.4+orb1 (linux/amd64) kubernetes/40f54c2,verb:GET (26-Oct-2023 18:14:00.368) (total time: 881ms):
Trace[2121159389]: ---"About to write a response" 868ms (18:14:01.236)
Trace[2121159389]: [881.154092ms] [881.154092ms] END
I1026 18:14:01.794587      39 trace.go:219] Trace[890984392]: "Patch" accept:application/vnd.kubernetes.protobuf,application/json,audit-id:9b15bd20-b9bc-425d-8603-ca406db4dc62,client:127.0.0.1,protocol:HTTP/2.0,resource:events,scope:resource,url:/api/v1/namespaces/kasten-io/events/dashboardbff-svc-6c5dc74f8b-hmbb7.178f7b1e2d1c9000,user-agent:k3s/v1.27.4+orb1 (linux/amd64) kubernetes/40f54c2,verb:PATCH (26-Oct-2023 18:13:59.626) (total time: 2168ms):
Trace[890984392]: ["GuaranteedUpdate etcd3" audit-id:9b15bd20-b9bc-425d-8603-ca406db4dc62,key:/events/kasten-io/dashboardbff-svc-6c5dc74f8b-hmbb7.178f7b1e2d1c9000,type:*core.Event,resource:events 2131ms (18:13:59.663)
Trace[890984392]:  ---"initial value restored" 1186ms (18:14:00.849)
Trace[890984392]:  ---"Txn call completed" 881ms (… took longer than expected" err="housekeeping took too long" expected="1s" actual="1.8s"
W1026 18:15:18.853320      39 sysinfo.go:203] Nodes topology is not available, providing CPU topology
I1026 18:15:19.755817      39 trace.go:219] Trace[676546670]: "List" accept:application/json, */*,audit-id:ddf64e4b-2b17-4994-b7c0-8095b5637380,client:192.168.194.25,protocol:HTTP/2.0,resource:secrets,scope:namespace,url:/api/v1/namespaces/kasten-io/secrets,user-agent:metering-server/v0.0.0 (linux/amd64) kubernetes/$Format,verb:LIST (26-Oct-2023 18:15:18.696) (total time: 1056ms):
Trace[676546670]: ---"Writing http response done" count:8 669ms (18:15:19.753)
Trace[676546670]: [1.056930541s] [1.056930541s] END
INFO[441604] Slow SQL (started: 2023-10-26 18:15:16.254037621 +0200 CEST m=+441600.563596685) (total time: 3.670791197s):  DELETE FROM kine AS kv WHERE kv.id IN ( SELECT kp.prev_revision AS id FROM kine AS kp WHERE kp.name != 'compact_rev_key' AND kp.prev_revision != 0 AND kp.id <= ? UNION SELECT kd.id AS id FROM kine AS kd WHERE kd.deleted != 0 AND kd.id <= ? ) : [[74021 74021]] 
FATA[441605] Transaction commit failed: sql: transaction has already been committed or rolled back 
[*] service 1 exited with exit status: 1

To Reproduce

I don't know how to reproduce it.

Expected behavior

No crash.

Diagnostic report (required)

OrbStack info: Version: 1.0.1 Commit: 0d4cdcf185489f992cf8e3187884f11f4feab1aa (v1.0.1)

System info: macOS: 13.5 (22G74) CPU: amd64, 12 cores CPU model: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Model: MacBookPro16,1 Memory: 32 GiB

Full report: https://orbstack.dev/_admin/diag/orbstack-diagreport_2023-10-26T16-18-57.847795Z.zip

Screenshots and additional context (optional)

No response

denisvmedia commented 1 year ago

@kdrag0n what kind extra info would you need for this issue?

kdrag0n commented 1 year ago

A reproducer would be best, but I'm not sure if that's feasible — hence the missing-info tag for now.

I would, however, highly recommend increasing OrbStack's memory limit. It's constantly running against the limit and being forced to kill processes, causing performance and potential stability issues. Chances are that you won't see this again if you increase it.