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

Fix failing go-dbhub CI test #322

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Fix failing go-dbhub CI test #322

merged 1 commit into from
Mar 8, 2024

Conversation

justinclift
Copy link
Member

@justinclift justinclift commented Mar 8, 2024

Ignore this for now.

The CI tests are failing, so this PR is just a way for me to trigger the CI tests while trying to figure out what's going on.

@justinclift justinclift changed the title Test1 v1 Investigate failing CI tests Mar 8, 2024
@justinclift
Copy link
Member Author

justinclift commented Mar 8, 2024

Ugh. This is making absolutely no sense to me at all.

The local DBHub.io daemons are clearly running and available for the go-dbhub test, as doing a netstat -nltp shows them to be there:

tcp        0      0 0.0.0.0:9443            0.0.0.0:*               LISTEN      -
...                   
tcp6       0      0 :::9443                 :::*                    LISTEN      -

Seeding the database works fine when testing locally in my system, and also works fine in the Cypress CI testing run for this PR. So why the hell is it failing when it's run as part of the go-dbhub library test?

2024/03/08 12:07:04 Seeding the database...
2024/03/08 12:07:04 Get "https://localhost:9443/x/test/seed": read tcp [::1]:59528->[::1]:9443: read: connection reset by peer
exit status 1
FAIL	github.com/sqlitebrowser/go-dbhub	0.008s

@justinclift
Copy link
Member Author

Ok, it looks like the problem also happens when trying to seed the database manually using curl:

$ curl -k https://localhost:9443/x/test/seed
curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to localhost:9443 

This feels like some change in the GitHub infrastructure has happened, breaking stuff. Not sure what yet.

@justinclift
Copy link
Member Author

So, whatever the problem is... it's not an IPv4 vs IPv6 thing as connecting to 0.0.0.0 instead of localhost (which forces IPv4) also didn't work.

@justinclift
Copy link
Member Author

Ok, so it looks like TLS/SSL itself is completely broken somehow:

$ sh -c 'echo "Q" | openssl s_client -connect localhost:9443'
write:errno=104
CONNECTED(00000003)
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 283 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
Error: Process completed with exit code 1.

Hmmm. Maybe it'll work if we use http instead of https?

@justinclift
Copy link
Member Author

justinclift commented Mar 8, 2024

Nope, that didn't work either:

$ curl http://0.0.0.0:9443/x/test/seed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (56) Recv failure: Connection reset by peer

It's almost like the calls to port 9443 are being intercepted by some other non-DBHub.io process, fucking everything up.

@justinclift
Copy link
Member Author

That's interesting. It looks like it started the docker DBHub.io daemons on the old port, even though this PR has updated it.

Sounds like it's not testing the source code in this PR (maybe using master instead?) when it's running the test.

@justinclift
Copy link
Member Author

justinclift commented Mar 8, 2024

I've just created an Ubuntu 20.04 VM on my local development pc, and set that up as a GitHub Runner.

Going to debug this further using that local GitHub Runner, as I can log in directly to that VM and try to figure out what is going wrong.

@justinclift
Copy link
Member Author

justinclift commented Mar 8, 2024

Aarrrrgh. This makes no sense.

When running the curl command to seed the database via the GitHub Action, it's failing on my local VM just the same as with the GitHub hosted runners:

$ curl -k https://localhost:9443/x/test/seed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:9443 

But running the exact same command (cut-and-pasted!) from the exact same user manually... works completely fine.

WHAT THE HELL IS GOING ON?

@justinclift
Copy link
Member Author

Holy crap. It actually passed this time around. Now to figure out why exactly... 😉

@justinclift
Copy link
Member Author

k. It looks like the actual problem was the DBHub.io daemons needed more time to start in the Docker container.

At least that's an easy thing to fix... after spending hours trying to figure out what the problem was. 😄

@justinclift justinclift changed the title Investigate failing CI tests Fix failing go-dbhub CI test Mar 8, 2024
@justinclift justinclift merged commit 12f9bc5 into master Mar 8, 2024
6 checks passed
@justinclift justinclift deleted the test1_v1 branch March 8, 2024 18:28
@lucydodo
Copy link
Member

lucydodo commented Mar 9, 2024

Looks like the issue has been resolved, Thank you. :)

@justinclift
Copy link
Member Author

Yeah, finally figured it out. 😄

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

Successfully merging this pull request may close these issues.

2 participants