Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

gui-butler

an itch.io butler wrapper for lazybones like me · By Sean

Issues on macOS 12.6.6 Monterey

A topic by 608creations created Jun 11, 2023 Views: 518 Replies: 18
Viewing posts 1 to 16
(2 edits)

Hi.

If this is an end-user problem, I apologize in advance. I'm just setting up a new project and seem to have run into a couple of issues.

API var is properly set. Login with butler (v15.21.0 stable) and gui-butler (v2.2.8) works; however, the "Remember me" check box doesn't seem to remember my login at all. Every time I start gui-butler and finish login, it states butler is up-to-date and that my local credentials are valid. So far, so good.

Subsequently, I'm taken to authorize gui-butler, which I do, but no projects are listed.

Am I just dense? Have I missed some crucial step? The project page is in Draft mode, so I don't know whether that has something to do with it.

Cheers,

[EDIT TO ADD: From the CLI, butler works fine. It's just gui-butler that appears to have problems.]

Developer

Hey, unfortunately I don't have a mac device to test on so this may be difficult to debug/fix if there is a program error.

To clarify a few things:

  • The project being in draft mode would not affect anything; both butler and the gui support draft projects.
  • You mention the CLI works: when you tested this, did you use a separate copy of the CLI you installed on your own, or did you use the copy of the CLI that ships alongside gui-butler?
  • You mention that after authorizing gui-butler, no projects are listed. At this point, does the UI look like your attached screenshot (i.e. it continues to show the "Login" prompt), or has the left side of the UI updated to show the project listing, and your project is just missing from the dropdown (i.e. like this screenshot below)?

Currently my best guess is that gui-butler has somehow saved an invalid or malformed API key, even though the one use for butler is working. If that's the case, you may be able to fix it by logging out, erasing your saved credentials, revoking them via your itch settings, and logging in again to create new ones.

Failing that, you could try building the project from source (available here), this will allow you to view the developer tools and see if there is any additional error info.

Hi.

If you're suggesting that gui-butler should be able to store its own credentials, that does not appear to be the case on macOS. If a locally-installed butler has not created its API key in ~/Library/Application Support/itch/butler_creds AND the app is opened from the Applications folder, gui-butler returns the following error:

Additionally, it warns to set the environment var BUTLER_API_KEY. When we do that, we get ...

Other workflows do not change the outcome. With a local butler and the API key unset, Wharf authentication proceeds as expected and the API key is written to the butler_creds file. My installed CLI butler at this point performs all tasks as expected. gui-butler does authenticate, but after itch authorizes gui-butler to access the account, the screen does not update from what you see above.

I have downloaded the source code, but I see this is all built in Javascript. I do have Xcode installed, but I have no idea what I might do to try and compile or debug this. Any chance you can give me a hint? 

Just adding that if I change directories into the gui-butler app itself to run butler, e.g.,

cd /Applications/gui-butler.app/Contents/Resources/app/butler

Using that butler from within the bundled app can successfully check the status of a project's channel. So, butler is working in any case. It's just the GUI that appears to be broken.

Developer

Hm that's strange, gui-butler is supposed to store it's own credentials, and setting an API key manually via environment variables is not something I expected or explicitly supported.

From your screenshot, it looks like it's stalling during the login call, which is surprising since there is a try-catch there and I'd expect it to at least give a generic error popup.

The project is based on electron, so if you'd like to try building from source, you'll need to:

  1. Install node/npm: https://nodejs.org/en/download
  2. Open a terminal inside the project folder
  3. run `npm i` to install the various dependencies
  4. run `npm start` to run in development mode

In development mode, the chrome devtools should be accessible and the console tab will hopefully provide more information about the stalled login.

From what I can see, only the Windows version of gui-butler actually works. I also downloaded and tested Linux and Windows versions. Windows version worked perfectly out of the box with no fiddling required. The Linux version, at least on Ubuntu 22.04, shows only this:


After a d'uh moment and putting a working butler into the expected folder, it starts, but proceeds no further than the official Mac build. The Console pane is entirely devoid of any messages:


Developer

Ah I think I found the problem with that linux error at least (filename case sensitivity issue), pushing up a fix for that atm.

For mac, I'd unfortunately need more info. If you're familiar enough with JS to tinker with it, you could try modifying the "login" function in App.js to try and narrow down where things are going wrong. We can see it's disabling the button and never re-enabling it, so the catch block and none of the "failLogin" lines are being reached, but I'm not sure where it's getting stuck.

Well, we're making progress. The Linux version now displays the GUI correctly. The bad news is that its login appears to stall exactly the same way that the Mac app does. This is what I see after authorizing a login (confirmed both with Firefox and Chrome as the Itch intermediary):

Since macOS uses a modified BSD under the hood, I'm not surprised that the behaviour between Linux and macOS is similar.

I don't really know anything about Javascript, so I'm unsure at this point what I can do. That said, given the parity of apparent behaviour on Linux, you might consider installing VirtualBox and Linux for doing eyes-on troubleshooting. Both are free.

(1 edit)

Is there any way we can put a timeout or ensure output of any incoming data for this gets printed to console? I suspect that this await just never actually receives anything ...

const auth = await api.invoke('oauth:login', document.querySelector('#rememberMe').checked);

I'm more familiar with step-through debuggers in an IDE, so I'm a bit out of my depth here.

Developer

OK, I've investigated some more and I'm still pretty confused, but I think I have a workaround in place for v2.3.1: If you have BUTLER_API_KEY set, that key will now be reused instead of gui-butler prompting you for a second authorization. This doesn't work in all cases since the key that wharf creates doesn't have access to the "my-games" API used to fetch the projects, but a manually created API key should cover both wharf and gui-butler's scope requirements and allow the app to work as expected. I was able to confirm this by testing on a VirtualBox Ubuntu setup with a new key.

The workaround is needed because I couldn't figure out the "bailing out: No credentials and stdin is not a terminal" error. It comes from butler's auth here, and I traced this through to the underlying golang libraries, but can't follow the code well enough to understand why a node child process would be seen as a terminal on Windows but not on Linux.

As for the login getting stuck: The issue here seems to be that the custom protocol used as the oauth redirect isn't registering properly, so the app has no way of completing the flow (I'm not sure how it looks on Mac, but on Linux I was able to see it prompt for which app to open, but gui-butler wasn't in the list). I was missing a couple build properties required for custom protocols to work on Mac that may have fixed this, but the new workaround will skip this flow anyway so this will only be relevant if the "not a terminal" issue is fixed at some point.

Hopefully this helps, lmk if you still have issues!

(1 edit)

We're VERY close to having this 100% sorted. Here's the GOOD:

  • 2.3.1 logs in on both macOS and Linux with this workaround.
  • That is true for both the Mac app distribution on your channel and under npm.

Here's the BAD:

  • gui-butler seems to use 'osx' as the channel name. Mac channel is called 'mac' on Itch.io, so the query fails with "No channel osx found".

In the UI itself, I would use "macOS" as the OS name and 'mac' as the actual channel name when communicating with the API.

The butler docs suggest that osx should also work, but it apparently doesn't:

If it contains mac or osx, it'll be tagged as a Mac executable

Thanks for the help. I appreciate it and commiserate with your frustration.

Just confirmed that Itch.io seems to accept either osx or mac as Mac channel names ... but treats them as actually separate channels. That just ... wow.

Developer

Oh haha, yeah the channel names can actually be whatever you want them to, the ones they suggest just don't require you to set the platform from your dashboard after having created them. If you're already using "mac" though, you should be able to use the freeform input in gui-butler to check/upload that channel instead of the recommended ones.

Glad to hear it's working now!

(+1)

Okay, gotcha. Just put the channel name in Other. Well, then, s'all good.

Thanks a bunch for your patience!

Hi guys, Im going thru the thread here because I'm having the exact same problem on the exact same system... I'm too dumb to understand how it was fixed though, can anyone here help me?
Thanks so much!! 

Developer

Hey there! The fixes/workarounds roughly summarized here would be:

lmk if neither of these work for you, or if you have more specific info about your issue

Wow, Lightning fast reply. Thanks so much man.

I have to admit I am a MASSIVE noob and I dont really touch code at all, so that's why I was looking into this. 

  • I tried to swap the butler terminal app with one that downloaded manually, nothing really changed
  • My noobyness is showing.. I can't seem to understand what you mean by setting that environment variable. I did generate a new key, but I have no clue how to link it to gui butler, or normal butler for that matter!

When I try to run butler's executable, it just runs and then exits, and I cant input anything.

Then I go to normal terminal and try to use any of the commands, they just.. don't work. "login" just says 'login' with no prompt for my auth key or name, and none of the other commands work either. Super weird, I've installed similar stuff using terminal before, I can't get any version of butler to work for some reason, tried using $butler and all of the other commands, am I doing something wrong? augh 

Also here's how gui butler launches, I try to click refresh and had reboot and the login window flashes for a milasecond and just goes back to this: 



I kept the GUI Butler terminal window open, here's the full message:  error occured in handler for butler, bailing out . No credentials and stdin is not a terminal - terminating 

I also poked around and found that there's supposed to be a file with a command line that is supposed to have my auth key in it?? I think?? which I would modify -- If I could find it. I dont see it in any of the folders 

I'll get out of your hair after this,  I was just shocked someone had the exact issue, and I didn't quite understand the solution given, THANK YOU for your help and explanation, I'm sorry I dont get it T_T 

Developer

To clarify the environment variable fix, what you should need to do is:

  1. Get an API key
    1. Go to the itch settings page for API keys
    2. Click "Generate new API key" -> A new row in the table will appear with source "web"
    3. Click "View" on this row
    4. Copy the revealed value
  2. Open a mac terminal
  3. In the terminal, run `export BUTLER_API_KEY=abc123` with "abc123" replaced with the copied key from step 1 -> this will temporarily set an environment variable
  4. From the same terminal, run the gui-butler application (I think on mac this is just `open app-name-or-filepath`)
  5. Click "login" -> the app should now show your games

The reason this is necessary is that on mac, the underlying butler command-line tool is refusing to communicate with the GUI app for the interactive login process, and providing an API key directly allows you to skip the typical login process. If the fix works for you, you can try setting up the environment variable in a more permanent way so you don't have to remember to do it manually (e.g. using a simple shortcut script or the system environment variables for your OS).

RE running the butler commands directly from command-line: You shouldn't need to do this to use the app, and I can't help debug it much since it's just the first party tool provided by itch, but if you're having trouble running it at all you could:

  • try running `butler --version` and make sure you're on latest
  • if you're not on the latest version, try running `butler upgrade`
  • try running `butler diag` to make sure your device is able to connect to the necessary APIs