dmigwi / migration

0 stars 0 forks source link

[DCR]: Ticket purchasing crashes the App #42

Open dmigwi opened 1 year ago

dmigwi commented 1 year ago
2023-03-21 16:53:27.794 [INF] DCR: [0] Connected block 0000000be3be6c0cb91c2fe934fe5740baa1d765d5031d97414ac2ed9ac21156, height 1105029, 0 wallet transaction(s)
2023-03-21 16:53:28.852 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:28.854 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:28.854 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:28.854 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:44.503 [INF] DCR: [0] Connected block 00000022065ca84c956ae6de328de67510df06755807f70f77fffe9ada775f4a, height 1105030, 0 wallet transaction(s)
2023-03-21 16:53:44.698 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:44.698 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:44.699 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:53:44.699 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:54:56.652 [INF] DCR: [0] Connected block 000000047de38d93b84d859e1e17563d1a5e4a419b31ddc7cdcdee2bc496ee5e, height 1105031, 0 wallet transaction(s)
2023-03-21 16:54:57.266 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:54:57.266 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:54:57.266 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:54:57.268 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:58:47.942 [INF] DCR: [0] Connected block 0000000c4460f40b6aa14e9b9a72d213407caa55bd2100cfdddc5d20b4025031, height 1105032, 0 wallet transaction(s)
2023-03-21 16:58:48.587 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:58:48.593 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:58:48.594 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:58:48.597 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:59:37.369 [INF] DCR: [0] Connected block 00000010b431e0de00aee655101a7e97d297d2faf6d54244a7b75e45088b4928, height 1105033, 0 wallet transaction(s)
2023-03-21 16:59:37.571 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:59:37.572 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:59:37.572 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 16:59:37.573 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
2023-03-21 17:00:15.563 [INF] DCR: [0] Connected block 0000000fece9ffd19651aa2bf7fd5857c99eb1bc690e9aaece0a3664767db9c4, height 1105034, 0 wallet transaction(s)
2023-03-21 17:00:15.790 [ERR] DCR: [10] Ticket purchasing failed: cannot authenticate server: invalid signature
fatal error: concurrent map writes

goroutine 5987 [running]:
code.cryptopower.dev/group/cryptopower/libwallet/utils.HttpRequest(0xc004389138, {0x13d0700?, 0xc00aa328d0})
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/utils/httpclient.go:190 +0x13d
code.cryptopower.dev/group/cryptopower/libwallet/internal/vsp.(*client).do(0xc00708b620, {0x1c04e50, 0xc00719a450}, {0x164cc4a, 0x3}, {0x1663b3f, 0xf}, {0x0, 0x0}, {0x13d4480, ...}, ...)
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/internal/vsp/client.go:71 +0x385
code.cryptopower.dev/group/cryptopower/libwallet/internal/vsp.(*client).get(...)
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/internal/vsp/client.go:44
code.cryptopower.dev/group/cryptopower/libwallet/internal/vsp.(*Client).FeePercentage(0xc006cc7520, {0x1c04e50, 0xc00719a450})
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/internal/vsp/vsp.go:81 +0xa5
decred.org/dcrwallet/v2/wallet.(*Wallet).purchaseTickets(0xc0006def00, {0x1c04e50, 0xc00719a450}, {0x1676be0, 0x16}, {0x1c0b630, 0xc006afdb10?}, 0xc004389eb8)
    /home/dmigwi/work/app/golang/pkg/mod/decred.org/dcrwallet/v2@v2.0.9/wallet/createtx.go:1410 +0xb5e
decred.org/dcrwallet/v2/wallet.(*Wallet).PurchaseTickets(0xc0006def00, {0x1c04e50, 0xc00719a450}, {0x1c0b630?, 0xc006afdb10?}, 0xc004389eb8)
    /home/dmigwi/work/app/golang/pkg/mod/decred.org/dcrwallet/v2@v2.0.9/wallet/wallet.go:1653 +0x85
code.cryptopower.dev/group/cryptopower/libwallet/assets/dcr.(*DCRAsset).buyTicket(0xc001f08410, {0x1c04da8?, 0xc01046aec0?}, {0x25c1368, 0x1}, 0xc0003387e0?, 0x10dca0, 0xc009b338f0)
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/assets/dcr/ticket.go:475 +0x325
code.cryptopower.dev/group/cryptopower/libwallet/assets/dcr.(*DCRAsset).runTicketBuyer.func1()
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/assets/dcr/ticket.go:402 +0x65
created by code.cryptopower.dev/group/cryptopower/libwallet/assets/dcr.(*DCRAsset).runTicketBuyer
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/libwallet/assets/dcr/ticket.go:424 +0xbde

goroutine 1 [select (no cases), 29 minutes]:
gioui.org/app.osMain(...)
    /home/dmigwi/work/app/golang/pkg/mod/gioui.org@v0.0.0-20230118222818-e0cf570339bd/app/os_unix.go:43
gioui.org/app.Main(...)
    /home/dmigwi/work/app/golang/pkg/mod/gioui.org@v0.0.0-20230118222818-e0cf570339bd/app/app.go:64
main.main()
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/main.go:114 +0x610

goroutine 22 [IO wait, 29 minutes]:
internal/poll.runtime_pollWait(0x7fe68edb3dd8, 0x72)
    /usr/local/go/src/runtime/netpoll.go:305 +0x89
internal/poll.(*pollDesc).wait(0xc001f94000?, 0x2?, 0x0)
    /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
    /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc001f94000)
    /usr/local/go/src/internal/poll/fd_unix.go:614 +0x234
net.(*netFD).accept(0xc001f94000)
    /usr/local/go/src/net/fd_unix.go:172 +0x35
net.(*TCPListener).accept(0xc001f84018)
    /usr/local/go/src/net/tcpsock_posix.go:142 +0x28
net.(*TCPListener).Accept(0xc001f84018)
    /usr/local/go/src/net/tcpsock.go:288 +0x3d
net/http.(*Server).Serve(0xc001f92000, {0x1c03cf8, 0xc001f84018})
    /usr/local/go/src/net/http/server.go:3070 +0x385
net/http.(*Server).ListenAndServe(0xc001f92000)
    /usr/local/go/src/net/http/server.go:2999 +0x7d
net/http.ListenAndServe(...)
    /usr/local/go/src/net/http/server.go:3255
main.main.func1()
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/main.go:47 +0x15d
created by main.main
    /home/dmigwi/work/app/golang/src/code.cryptopower.dev/dmigwi/cryptopower/main.go:45 +0xbc

(Issue originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

i have auto ticket buyer running, i was able to start it without a crash. can you provide more info, however i'm looking into the source of the crash

Screenshot_from_2023-03-22_17-32-04

By Kennedy Izuegbu on 2023-03-22T16:35:40 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

although i don't see anything in the logs after starting ticket buyer, even when i input a wrong password nothing happens

By Kennedy Izuegbu on 2023-03-22T16:37:03 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

I believe the crash is partly due to a wrong password input.

By Migwi Ndung'u on 2023-03-22T16:37:39 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

@dmigwi can you provide more info on how you got this crash(sever used etc) and if there is a means to replicate it?

By Kennedy Izuegbu on 2023-03-22T16:35:40 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

doesn't occur for me, so would need exact replication steps if available

By Kennedy Izuegbu on 2023-03-22T16:39:17 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

Tried it again but I hasn't crashed. All is well.

I think the main issue is concurrent map writes crash, is it possible to investigate how that happen.

Ticket purchasing failed: cannot authenticate server: invalid signature might be an upstream issue.

By Migwi Ndung'u on 2023-03-22T16:50:17 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

Yes , I'm looking into that, would let you know tomorrow

By Kennedy Izuegbu on 2023-03-22T16:59:58 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

this error is coming from upstream, and i am unable to replicate it, but it seems like the vsp server had a failure, i'd backlog this for now, perhaps we need to run a test on mainnet

By Kennedy Izuegbu on 2023-03-27T15:10:11 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

assigned to @dreacot

By Kennedy Izuegbu on 2023-03-22T16:25:32 (imported from GitLab)

(Comment originally authored by: Kennedy Izuegbu in gitlab.com)