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

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

Open
tarvos21 opened this issue Mar 8, 2017 · 25 comments
Open

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

tarvos21 opened this issue Mar 8, 2017 · 25 comments

Comments

@tarvos21
Copy link

tarvos21 commented Mar 8, 2017

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!

@chrismetcalf
Copy link

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

@gharlan
Copy link
Owner

gharlan commented Mar 9, 2017

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

@chrismetcalf
Copy link

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/>

@dotemacs
Copy link

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

@tarvos21
Copy link
Author

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

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

@dotemacs
Copy link

@tarvos21 did you really mean to close this issue?

@gharlan gharlan reopened this Mar 10, 2017
@tarvos21
Copy link
Author

tarvos21 commented Mar 10, 2017

@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 tarvos21 changed the title Nothings happens with "gh s ..." Nothings happens with "gh s ..." or anyother commands Mar 10, 2017
@tarvos21 tarvos21 changed the title Nothings happens with "gh s ..." or anyother commands Nothing happens with "gh s ..." or any other commands Mar 10, 2017
@gharlan
Copy link
Owner

gharlan commented Mar 10, 2017

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"

@chrismetcalf
Copy link

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"

@dotemacs
Copy link

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

@chrismetcalf
Copy link

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.

@dotemacs
Copy link

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

Thanks @chrismetcalf :)

@hoodwink73
Copy link

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

@Y4m1n
Copy link

Y4m1n commented May 31, 2017

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?

@chrismetcalf
Copy link

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

@xavez
Copy link

xavez commented Sep 1, 2017

Thanks @chrismetcalf, that worked for me too!

@Averethel
Copy link

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
Copy link

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

@derekclee
Copy link

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.

@liyang85
Copy link

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.

@iT-Boyer
Copy link

@chrismetcalf very good!

@gharlan
Copy link
Owner

gharlan commented Sep 12, 2022

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 #82 (comment).)

@fjuniorr
Copy link

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

@benmoss
Copy link

benmoss commented Dec 7, 2023

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
Copy link

benmoss commented Dec 7, 2023

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:

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

No branches or pull requests