alfred-github-workflow icon indicating copy to clipboard operation
alfred-github-workflow copied to clipboard

Nothing happens with "gh s ..." or any other commands

Open tarvos21 opened this issue 7 years ago • 25 comments

Hi, I find GitHub-workflow rather great, I login in, and it works for a while, however, suddenly it responses nothing to any command(at least for a while), especially when I type "gh s ...", it deletes all my inputs, and only left "gh s" in Alfred 3, I am on a macOS Sierra system, what may be the problem?

I have tried to reboot my computer and also quit Alfred, and disabled the workflow and enable it, but it does not help.

In fact, this workflow crashes once in while, I mean it works fine now, but after several minutes, it does not work, weird, anyone has encountered the same problem? Thanks!

tarvos21 avatar Mar 08 '17 16:03 tarvos21

I'm seeing this too! Tried deleting and reinstalling, gh > delete database, etc. and no changes.

chrismetcalf avatar Mar 09 '17 22:03 chrismetcalf

Please open the workflow in alfred preferences and activate the debug mode. Is there any error?

gharlan avatar Mar 09 '17 22:03 gharlan

Nothing that useful:

Starting debug for 'GitHub'

[2017-03-09 16:09:22][input.scriptfilter] <?xml version="1.0"?>
<items><item uid="19b19ffc30caef1c9376cd2982992a59" autocomplete=" " valid="no"><icon>icon.png</icon><title>gh&#x2026;</title><subtitle>Search or type a command</subtitle></item></items>
[2017-03-09 16:09:36][input.scriptfilter] <?xml version="1.0"?>
<items><item uid="19b19ffc30caef1c9376cd2982992a59" autocomplete=" " valid="no"><icon>icon.png</icon><title>gh&#x2026;</title><subtitle>Search or type a command</subtitle></item></items>
[2017-03-09 16:09:53][input.scriptfilter] <?xml version="1.0"?>
<items><item uid="19b19ffc30caef1c9376cd2982992a59" autocomplete=" " valid="no"><icon>icon.png</icon><title>gh&#x2026;</title><subtitle>Search or type a command</subtitle></item></items>

I've tried running search.php manually from the command line, and I just get an empty XML doc:

[metcalf@metcalf user.workflow.7893FB74-1AAB-4269-B57A-F62CB83F872F ]$ php -f search.php -- "dev.socrata"
<?xml version="1.0"?>
<items/>

chrismetcalf avatar Mar 10 '17 00:03 chrismetcalf

Hi, I'm seeing the same thing.

When I type gh > login, it just deletes all leaving only gh and nothing else.

Tried it with the debugging turned on, but I'm getting no output.

I type gh some-user/some-repo, it just deletes all, leaving only gh with no debugging output.

I figured I'd try uninstalling it and installing it again, just to be pedantic, but that didn't change anything. The workflow acts as above.

Thanks

dotemacs avatar Mar 10 '17 06:03 dotemacs

Yes, I got the same result as @chrismetcalf, "...version="1.0....".

Is it possible that it's caused by the network connection problem?

tarvos21 avatar Mar 10 '17 06:03 tarvos21

@tarvos21 did you really mean to close this issue?

dotemacs avatar Mar 10 '17 07:03 dotemacs

@gharlan, oh, sorry, I made a mistake by clicking "close and comment", while actually I want to "cancel" the comment above.

I am not sure whether it's caused by internet connection, I can connect GitHub without proxy, but need proxy to connect Google.

Today, when I type "gh ...." in Alfred 3, nothings happens anymore, only left "gh" in the input, same with @dotemacs.

I type in any commend:

screen shot 2017-03-10 at 4 30 32 pm

After I hit enter:

screen shot 2017-03-10 at 4 31 48 pm

tarvos21 avatar Mar 10 '17 08:03 tarvos21

I've tried running search.php manually from the command line, and I just get an empty XML doc:

You have to run it like this (the query has to start with a space):

php search.php github " dev.socrata"

gharlan avatar Mar 10 '17 09:03 gharlan

Hmm, tried with the space in the query as you suggested, and now it just hangs:

[metcalf@metcalf user.workflow.7893FB74-1AAB-4269-B57A-F62CB83F872F ]$ php search.php github " dev.socrata"

chrismetcalf avatar Mar 10 '17 17:03 chrismetcalf

Let me add my bit.

My setup:

  • OSX 10.11.6
  • Alfred v3.3.1 [806]
  • GitHub for Alfred v1.5
  • $ php -v PHP 5.5.38 (cli) (built: Aug 21 2016 21:48:49) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

Like @chrismetcalf when I run the workflow like this:

$ php search.php github " dev.socrata"

it hangs for a while, then it barfs:

$ php search.php github " dev.socrata"

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 5 database is locked' in /Users/alex/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.91EE911D-C382-406C-9F99-8647D8D20B7B/workflow.php:206
Stack trace:
#0 /Users/alex/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.91EE911D-C382-406C-9F99-8647D8D20B7B/workflow.php(206): PDOStatement->execute(Array)
#1 /Users/alex/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.91EE911D-C382-406C-9F99-8647D8D20B7B/workflow.php(357): Workflow::requestCache('https://api.git...', NULL, NULL, true, 1440)
#2 /Users/alex/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.91EE911D-C382-406C-9F99-8647D8D20B7B/search.php(41): Workflow::checkUpdate()
#3 /Users/alex/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.91EE911D-C382-406C-9F99-8647D8D20B7B/search.php(608): Search::r in /Users/alex/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.91EE911D-C382-406C-9F99-8647D8D20B7B/workflow.php on line 206

The contents of workflow.php line 206:

self::getStatement('UPDATE request_cache SET refresh = ? WHERE url = ?')->execute(array(time(), $url));

Hope that helps

dotemacs avatar Mar 10 '17 20:03 dotemacs

I can't tell you why it worked, but deleting the workflow's working directory (/Users/$USER/Library/Application Support/Alfred 3/Workflow Data/de.gh01.alfred.github) cleared the cache and things seem to work again.

chrismetcalf avatar Mar 10 '17 22:03 chrismetcalf

I've followed @chrismetcalf's suggestion and can confirm that the workflow is working again.

Thanks @chrismetcalf :)

dotemacs avatar Mar 10 '17 22:03 dotemacs

Same thing happend to me. @chrismetcalf's suggestion fixes the problem.

hoodwink73 avatar May 13 '17 17:05 hoodwink73

Hi @chrismetcalf

screen shot 2017-05-31 at 5 35 05 pm

As we see, I couldn't log in, after clearing the cache it still didn't work for me, so I tried php search.php github " dev.socrata"

and got:

Fatal error: Function name must be a string in /Users/apple/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C32ADCD3-6AD4-47BA-AD45-8A51587F2D9C/curl.php on line 74

Could you give me some suggestions?

Y4m1n avatar May 31 '17 09:05 Y4m1n

@Y4m1n Not sure. If I had to guess, its something to do with the PHP setup on your machine

chrismetcalf avatar Jun 01 '17 01:06 chrismetcalf

Thanks @chrismetcalf, that worked for me too!

xavez avatar Sep 01 '17 07:09 xavez

I have the same. I reinstalled the workflow, but it did not help. I then tried to do what @chrismetcalf suggested. This allowed me to login, but it still hangs when I try to search.

The PHP script executes just fine and there's nothing in debug...

Averethel avatar Oct 03 '17 08:10 Averethel

Oh very interesting, now that I've run the script manually it works again

Averethel avatar Oct 03 '17 08:10 Averethel

I had the same issue as @Averethel . Deleting Workflow Data was not enough. I also deleted the preferences folder, found from right clicking the GitHub workflow in alfred and selecting Open in Terminal. Running the script manually was initially returning no results until I ran it with my username as the search string. Then it started returning results and everything was working again for other searches.

derekclee avatar Oct 31 '17 03:10 derekclee

I often face the same issue for the past year, and it's very annoying.

System info:

  • macOS Catalina 10.15.5
  • Alfred version: 4.1 [1167]
  • GitHub for Alfred version: v1.6.2

My workaround:

  1. Delete "~/Library/Application Support/Alfred/Workflow Data/de.gh01.alfred.github".
  2. Delete GitHub for Alfred in Alfred Preferences.
  3. Re-install GitHub for Alfred.
  4. Re-login by gh > login.
  5. Things go back to normal.

liyang85 avatar Jul 21 '20 05:07 liyang85

@chrismetcalf very good!

iT-Boyer avatar Dec 25 '21 01:12 iT-Boyer

The next time the problem appears please open debug mode in alfred preferences of this workflow. And call the workflow again. Any error message? (I try to figure out if it is always the locked database problem as in https://github.com/gharlan/alfred-github-workflow/issues/82#issuecomment-285774530.)

gharlan avatar Sep 12 '22 16:09 gharlan

I can't tell you why it worked, but deleting the workflow's working directory (/Users/$USER/Library/Application Support/Alfred 3/Workflow Data/de.gh01.alfred.github) cleared the cache and things seem to work again.

This solved the problem for me as well. But here are the error messages from the debug mode before deleting de.gh01.alfred.github:

[11:01:42.047] Logging Started...
[11:01:47.508] GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] Queuing argument ''
[11:01:47.632] GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] Script with argv '' finished
[11:01:47.635] GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] <?xml version="1.0"?>
<items><item uid="19b19ffc30caef1c9376cd2982992a59" autocomplete=" " valid="no"><icon>icon.png</icon><title>gh&#x2026;</title><subtitle>Search or type a command</subtitle></item></items>
[11:01:57.169] GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] Queuing argument ' '
[11:01:57.277] GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] Script with argv ' ' finished
[11:01:57.280] ERROR: GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] Code 255: Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: config in /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php:433
Stack trace:
#0 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php(433): PDO->prepare('SELECT value FR...')
#1 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php(88): Workflow::getStatement('SELECT value FR...')
#2 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php(350): Workflow::getConfig('version')
#3 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/search.php(33): Workflow::checkUpdate()
#4 /Users/macbook/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/EECC38B3 in /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php on line 433
[11:01:57.283] ERROR: GitHub[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03%3EFC76BC27-8BCB-4BEE-AD42-EAC2D9B01F0F)] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: config in /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php:433
Stack trace:
#0 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php(433): PDO->prepare('SELECT value FR...')
#1 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php(88): Workflow::getStatement('SELECT value FR...')
#2 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php(350): Workflow::getConfig('version')
#3 /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/search.php(33): Workflow::checkUpdate()
#4 /Users/macbook/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/EECC38B3 in /Users/macbook/Dropbox/home/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C890BAEF-36BA-474A-9C25-F05A630A8B03/workflow.php on line 433

fjuniorr avatar Nov 12 '22 14:11 fjuniorr

I had to write the Script Filter to a file on disk and then run it with php, aka

Copy this to your clipboard

<?php

require 'search.php';

Search::run('github', $argv[1], getenv('hotkey'));

echo Workflow::getItemsAsXml();

In the workflow directory (ie ~/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.<UUID>):

pbpaste > foo.php
php foo.php " dev.whatever"

After running that once the Alfred workflow works as normal. Weird.

benmoss avatar Dec 07 '23 14:12 benmoss

Spoke too soon, I gave the workflow an access token and now it just hangs. I see this error in the debugger:

[09:55:25.446] ERROR: GitHub[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:

benmoss avatar Dec 07 '23 14:12 benmoss