-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Failed to connect to WakaTime, API Key or endpoint URL invalid ? #514
Comments
What did you put as the API url and did you make sure your WakaTime key is valid? |
Yes of course, for testing another key, I regenerated an another. |
What did you put as the API url? |
This one |
I added some more detailed logging. Please try again and I'll check the server logs afterwards. |
Owww... I just tested with my WakaTime classic key, and not from https://wakatime.com/developers#authentication
All are imported correctly! |
I also got this issue on a self-hosted instance (Using HTTP and accessing via IPs, not public domain). When I run your suggestion above in console I get this: ~ curl https://wakatime.com/api/v1/users/current/data_dumps -H "Authorization: Basic $(echo 'waka_xxx' | base64)"
{"data": [{"id": "xxx", "type": "heartbeats", "download_url": "https://wakatime.s3.amazonaws.com/coding-activity-exports/xxx/wakatime-xxx.json?AWSAccessKeyId=xxx&Signature=xxx%3D&Expires=1710753747", "status": "Completed", "percent_complete": 100.0, "expires": "2024-03-18T09:20:24Z", "created_at": "2024-03-11T08:46:40Z", "is_processing": false, "has_failed": false, "is_stuck": false}], "total": 1, "total_pages": 1}% I have got a valid JSON download from Wakatime's page, but not sure how to use it (is it possible?). When I enter my details in settings / integrations page, I am stuck on wakapi | 2024-03-11T21:12:27.871698498Z [INFO ] [request] status=400, method=POST, uri=/settings, duration=10.009982447s, bytes=48332, addr=172.16.3.9:37392, user=xxx I've tried various variations of inputs and legacy mode |
Super weird! It's probably the same issue as in #602 (comment), where we also had the problem that requests from cURL or a browser went fine, but timed out in Go. The workaround described in that comment would probably work here as well. But I'd rather want to find the root cause of the problem and reveal why it only occurs for some users (and not on wakapi.dev, for instance). Can you please try Also, what Go- and Wakapi versions are you using and which OS are you on? Do you have both IPv4 and IPv6 available with your ISP or only one or the other? |
Tried both URLs, same result. Using Debian, running in Docker. ISP got both IPv4 and IPv6 here. Version of Wakapi is latest, recently pulled, this is my first time setting up. Building on your hunch, I went inside the docker container and tried to run the command from there... and no response! (using wget instead of curl, as curl/apt is not available inside the container) docker compose exec -it wakapi /bin/sh;
$ wget -O- --header="Authorization: Basic $(echo -n 'waka_xxx' | base64)" https://wakatime.com/api/v1/users/current/data_dumps
Connecting to wakatime.com (143.198.244.187:443)
# And it just hangs.... forever 👻 So blaming this one on the container/docker! Then I switched the network mode in docker-compose from docker compose exec -it wakapi /bin/sh;
$ wget -O- --header="Authorization: Basic $(echo -n 'waka_xxx' | base64)" https://wakatime.com/api/v1/users/current/data_dumps
Connecting to wakatime.com ([2604:a880:4:1d0::fd:3000]:443)
writing to stdout
- 100% |***************************************************************************************************************************************| 42 0:00:00 ETA
written to stdout Also looks like it switched to using IPv6 to connect now, first time it attempted over IPv4? An odd but maybe inconsequential observation. Alright, at least it works, but not optimal to run this way. So I'm switching back to port mode and turning off host-mode, to test some more: # Can we connect to the internet? Yes:
docker compose exec -it wakapi /bin/sh;
$ wget -O- http://httpbin.org/get
Connecting to httpbin.org (107.21.176.221:80)
writing to stdout
{
"args": {},
"headers": {
"Host": "httpbin.org",
"User-Agent": "Wget",
"X-Amzn-Trace-Id": "Root=1-65f0b048-5ce731233c15cf02723fce25"
},
"origin": "81.167.234.40",
"url": "http://httpbin.org/get"
}
- 100% |**************************************************************| 225 0:00:00 ETA
written to stdout
# Ok some more IP testing, can we do IPv6?
$ wget -qO- http://ipv6-test.com/api/myip.php
81.167.000.000
# No, that's certainly an IPv4 address, outside the container it returns as IPv6 Alright so maybe you're hunch about IPv4 / IPv6 is correct. Building on that theory, outside the container I force WakaTime API to query via IPv4:
And nothing, no response! Remove the My conclusion so far:
I do not comprehend why I cant query Wakatime API on some of my VMs via IPv4, one thing those VMs have in common is using Proxmox 8 SDN, but I am not seeing issues with other IPv4 services. What should maybe be investigated is making IPv6 work inside the container? |
Wow, thanks a lot for your detailed investigations!
Last time I checked, Docker didn't even support IPv6 whatsoever, so But still, could you please check if (a) your container actually has an IPv6 and (b) you can force Please also try different combinations of IPv4 vs. IPv6, inside vs. outside container and with vs. without |
I've tried "everything", only ting I can pinpoint is that my IPv6 handling in a certain subnet I got is not working reliably. And it seems that the IPv4 connection to WakaAPI also is struggling in that subnet. # Both of these queries either fail or work (at least on my weird network)
wget -qO- -6 https://6.ipwho.de/ip
wget -qO- -4 https://api.wakatime.com/api/v1/meta Thanks for your help, seems like this is a me problem and not a Wakapi problem. |
Keep me posted, would love to learn how you got this fixed in the end! Also, let me know if I can provide further help. |
Describe the bug
Hello, I would like connect my Wakatime account to Wakapi from https://wakapi.dev/settings#integrations, but when I submit the form, I've this error:
System information
Wakapi version : v2.8.1-a9364e3 @ mysql
On https://wakapi.dev/
The text was updated successfully, but these errors were encountered: