Open grantmcconnaughey opened 2 years ago
My GitLab access token shows as never being used:
@grantmcconnaughey This is a config issue - can you try glseturl https://gitlab.com/api/v4/projects
I do see that in the README now! 🤦 Unfortunately, I'm getting the same result after that.
Do the log files still show it as a HTTP 400 error?
Nope, looks like they did change. It doesn't recognize the scheme (https?):
15:17:31 background.py:285 ERROR [__workflow_update_check] command failed with status 1
15:17:31 update.py:12 INFO Calling API page 1
15:17:31 workflow.py:2114 ERROR ('unrecognized scheme', '')
Traceback (most recent call last):
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/workflow/workflow.py", line 2107, in run
func(self)
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/update.py", line 38, in main
projects = wf.cached_data('projects', fetch_gitlab_projects, max_age=3600)
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/workflow/workflow.py", line 1723, in cached_data
data = data_func()
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/update.py", line 36, in fetch_gitlab_projects
return get_projects(api_key, api_url)
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/update.py", line 8, in get_projects
return get_project_page(api_key, url, 1, [])
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/update.py", line 13, in get_project_page
response = mureq.get(url, params=({'private_token': api_key, 'per_page': 100, 'page': page, 'membership': 'true'}))
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/mureq.py", line 52, in get
return request('GET', url=url, **kwargs)
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/mureq.py", line 40, in request
with yield_response(method, url, **kwargs) as response:
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/mureq.py", line 124, in yield_response
url, conn, path = _prepare_request(method, url, enc_params=enc_params, timeout=timeout, unix_socket=unix_socket, verify=verify, source_address=source_address, ssl_context=ssl_context)
File "~/Alfred.alfredpreferences/workflows/user.workflow.78188B4B-A351-4C3D-A3EE-1A1732DD54AF/mureq.py", line 351, in _prepare_request
raise ValueError("unrecognized scheme", scheme)
ValueError: ('unrecognized scheme', '')
Removing the scheme fixed it!
glseturl gitlab.com/api/v4/projects
Well thats funky. I'll take a look, thanks!
You bet! Thanks for rubber duckin' with me. I'll leave it up to you whether to close now or close after addressing the scheme issue. Cheers.
Also having problems here, but logs show the following with glseturl https://gitlab.com/api/v4/projects
mureq.HTTPErrorStatus: HTTP response returned error code 401
When I change the URL to my actual URL (https://gitlab.companyname.net/api/v4/projects
) I get the following:
Traceback (most recent call last):
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/workflow/workflow.py", line 2107, in run
func(self)
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/update.py", line 38, in main
projects = wf.cached_data('projects', fetch_gitlab_projects, max_age=3600)
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/workflow/workflow.py", line 1723, in cached_data
data = data_func()
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/update.py", line 36, in fetch_gitlab_projects
return get_projects(api_key, api_url)
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/update.py", line 8, in get_projects
return get_project_page(api_key, url, 1, [])
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/update.py", line 20, in get_project_page
projects = stored_projects + response.json()
File "/Users/ggydush/Documents/Alfred.alfredpreferences/workflows/user.workflow.15193ABD-CE38-4CAF-8D43-D52082DC68CD/mureq.py", line 191, in json
return jsonlib.loads(self.body)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Same here, i thought this workflow wasn't working with alfred 4 due the "Quickly navigate to GitLab projects in Alfred 3" in the readme.
Works fine with the URL https://mygitlab.x/api/v4/projects
I recently updated alfred-gitlab to version 3.0.0 following the instructions in the README. Unfortunately, it's still not working for me on macOS 12.3. Here are steps to reproduce:
glsetkey {key}
glseturl https://gitlab.com
I get the message "No projects found."
Here's the debug output from the previous command:
If I open the
com.lukewaite.alfred-gitlab.log
log file then I do see there was a 400 response when calling GitLab's API: