Welcome, all, to the rabbit hole that has been me trying to get butler to work even a little bit on gitlab CI.
Here's the relevant bits of my CI file:
itch: stage: deploy image: dosowisko/butler when: manual script: - mkdir -p ~/.config/itch - echo ${BUTLER_API_KEY} > ~/.config/itch/butler_creds - butler login - butler push ./build/unstable atiaxi/tyranny-of-the-labyrinth:web --userversion-file ./VERSION.txt --verbose
Now, if you've seen any other "how to deploy using butler on gitlab CI" tutorials, you may be wondering what the deal with `butler login` is up there, because none of them have it. The deal is, without it I get this error:
$ butler push build/unstable atiaxi/tyranny-of-the-labyrinth:web --userversion-file ./VERSION.txt creating build on remote server: Post "<a href="https://api.itch.io/wharf/builds">https://api.itch.io/wharf/builds</a>": http: ContentLength=71 with Body length 0 Cleaning up project directory and file based variables00:01 ERROR: Job failed: exit code 1
Note that is not a "you have bad credentials" error (that would have given a useful error message, as I verified by deliberately mangling the credentials), it's just some bizarre error that doesn't explain itself and diving into the source told me nothing. I can provide a verbose version of this error if needed, but it contains no useful additional information (the traceback just points to the `.Post` calls, as you'd expect).
So, I added the bit where it puts the API key where butler expects to find it, and then it logs in. And that worked! Exactly once.
When I revoked that key (because, in my debugging, I'd resorted to straight-up just printing the stupid thing out) and tried a new one, it failed again. Did it fail with a reasonable error message? Well, this post isn't titled "several different reasonably-explained ways that butler is failing" so no. Instead, this!
$ butler login validating credentials: Get "<a href="https://api.itch.io/wharf/status">https://api.itch.io/wharf/status</a>": context deadline exceeded
Google tells me that the answer to this error is "get better internet lul" which doesn't help much. Fortunately those answers are old, because since the time they were posted butler added a handy command line flag to actually tell it to wait longer! Useful...
$ butler login --context-timeout=120 validating credentials: http: read on closed response body
unless of course it's the server that's decided to (presumably) time out for - wait for it - unexplained reasons!
So after spending a solid several hours on and off throughout the day trying to get this to work, I'm officially throwing in the towel and asking here. Is there anything I haven't tried that I should be trying, or things I have tried that I shouldn't? What on earth is happening here? Why does every other butler problem on the entire internet that I've googled have reasonable error messages except for this specific one that's afflicting me? Why am I so hungry and tired?
Actually, I'll take care of that last one right now, I think. Thanks for reading through this half problem half rant of a post.
(Incidentally, of course, all of this works entirely flawlessly on windows, because linux hates me today I guess).