Stefan Kleineikenscheidt Posted April 18, 2017 Share Posted April 18, 2017 (edited) Hey all, I have just published the Alfred Confluence workflow. The Alfred Confluence workflow let's you find and open Confluence pages and blog posts from Alfred. Once installed and set up, just type c <search terms> ('c' standing for Confluence). Download & Links: Latest Release: https://github.com/skleinei/alfred-confluence/releases/download/1.0.2/alfred-confluence.alfredworkflow Docs: https://github.com/skleinei/alfred-confluence Packal: http://www.packal.org/workflow/alfred-confluence-quick-search I've tested with Alfred 3 and on macOS Sierra. Hope you find it useful. Cheers, -Stefan Edited April 18, 2017 by Stefan Kleineikenscheidt seanrwcrawford 1 Link to comment
mcoppola Posted May 16, 2017 Share Posted May 16, 2017 Hey Stefan, Thank you for creating and publishing this workflow! I'm trying to use it and have run into an error, wondering if you may have any insight to the problem. I am seeing "No JSON object could be decoded", when attempting a search. (screenshot below) Seems like the authentication has worked, but I may have something misconfigured. Thanks for the help! -Matt Link to comment
Stefan Kleineikenscheidt Posted May 18, 2017 Author Share Posted May 18, 2017 Hey Matt, not sure what happend here. Did you use the "advanced configuration" in order to connect to multiple Confluence-Systems? (https://github.com/skleinei/alfred-confluence#advanced-configuration) If so, please post contents of the ~/.alfred-confluence.json file. -Stefan Link to comment
Dollar2048 Posted May 31, 2017 Share Posted May 31, 2017 (edited) Hello, sorry. But how to set baseUrl and other properties? c confluence_baseurl https://wiki.example.com doesn't work (it does nothing on return and continues to ask to set baseurl. Edited May 31, 2017 by Dollar2048 Link to comment
Dollar2048 Posted May 31, 2017 Share Posted May 31, 2017 11 minutes ago, Dollar2048 said: Hello, sorry. But how to set baseUrl and other properties? c confluence_baseurl https://wiki.example.com doesn't work (it does nothing on return and continues to ask to set baseurl. sorry, I should not use "c" at the beginning. )) Stefan Kleineikenscheidt 1 Link to comment
doctorwho Posted June 4, 2017 Share Posted June 4, 2017 On 5/17/2017 at 0:01 AM, mcoppola said: Hey Stefan, Thank you for creating and publishing this workflow! I'm trying to use it and have run into an error, wondering if you may have any insight to the problem. I am seeing "No JSON object could be decoded", when attempting a search. (screenshot below) Seems like the authentication has worked, but I may have something misconfigured. Thanks for the help! -Matt Hi, - having the same error - debug logs from when trying to run the workflow, Starting debug for 'Confluence Quick Search v1.0.2' [2017-06-04 15:59:31][ERROR: input.scriptfilter] Code 1: 15:59:30 workflow.py:1859 DEBUG Loading cached data from : /Users/myusername/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.k15t.labs.alfredapp.confluence.quicksearch/__workflow_update_status.cpickle 15:59:30 workflow.py:2444 DEBUG update_data : {u'available': False} 15:59:30 workflow.py:2225 DEBUG Workflow version : 1.0.2 15:59:30 workflow.py:1628 DEBUG Reading settings from `/Users/myusername/Library/Application Support/Alfred 3/Workflow Data/com.k15t.labs.alfredapp.confluence.quicksearch/settings.json` ... 15:59:30 workflow.py:2514 DEBUG Update check not due 15:59:30 workflow.py:2633 DEBUG Got password : com.k15t.labs.alfredapp.confluence.quicksearch:confluence_password 15:59:30 alfred-confluence.py:99 DEBUG Quick Search URL: https://myconfluencepage.jira.com/wiki/rest/quicknav/1/search?os_authType=basic&query=v 15:59:31 workflow.py:2243 ERROR No JSON object could be decoded Traceback (most recent call last): File "/Users/myusername/alfred/Alfred.alfredpreferences/workflows/user.workflow.3843EB14-BDB0-474B-9840-DDE6E3DB23E4/lib/workflow/workflow.py", line 2236, in run func(self) File "alfred-confluence.py", line 108, in main result = r.json() File "/Users/myusername/alfred/Alfred.alfredpreferences/workflows/user.workflow.3843EB14-BDB0-474B-9840-DDE6E3DB23E4/lib/workflow/web.py", line 269, in json return json.loads(self.content, self.encoding or 'utf-8') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 351, in loads return cls(encoding=encoding, **kw).decode(s) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded 15:59:31 workflow.py:2267 DEBUG Workflow finished in 1.093 seconds. Appreciate the help Link to comment
Stefan Kleineikenscheidt Posted June 5, 2017 Author Share Posted June 5, 2017 Hey doctorwho, try to configure by just typing 'confluence_baseurl', etc. (without the 'c'). -Stefan Link to comment
doctorwho Posted June 6, 2017 Share Posted June 6, 2017 Hi Stefan, Configured by just typing 'confluence_baseurl' without the 'c' and still having the issue. Below is the complete logs (earlier log filtered by Alfred's "interesting information") [2017-06-06 10:13:27][ERROR: input.scriptfilter] Code 1: 10:13:25 workflow.py:1859 DEBUG Loading cached data from : /Users/myusername/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.k15t.labs.alfredapp.confluence.quicksearch/__workflow_update_status.cpickle 10:13:25 workflow.py:2444 DEBUG update_data : {u'available': False} 10:13:25 workflow.py:2225 DEBUG Workflow version : 1.0.2 10:13:25 workflow.py:1628 DEBUG Reading settings from `/Users/myusername/Library/Application Support/Alfred 3/Workflow Data/com.k15t.labs.alfredapp.confluence.quicksearch/settings.json` ... 10:13:25 workflow.py:2514 DEBUG Update check not due 10:13:25 workflow.py:2633 DEBUG Got password : com.k15t.labs.alfredapp.confluence.quicksearch:confluence_password 10:13:25 alfred-confluence.py:99 DEBUG Quick Search URL: https://mycompanyname.jira.com/wiki/rest/quicknav/1/search?os_authType=basic&query=myquery 10:13:26 workflow.py:2243 ERROR No JSON object could be decoded Traceback (most recent call last): File "/Users/myusername/alfred/Alfred.alfredpreferences/workflows/user.workflow.3843EB14-BDB0-474B-9840-DDE6E3DB23E4/lib/workflow/workflow.py", line 2236, in run func(self) File "alfred-confluence.py", line 108, in main result = r.json() File "/Users/myusername/alfred/Alfred.alfredpreferences/workflows/user.workflow.3843EB14-BDB0-474B-9840-DDE6E3DB23E4/lib/workflow/web.py", line 269, in json return json.loads(self.content, self.encoding or 'utf-8') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 351, in loads return cls(encoding=encoding, **kw).decode(s) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded 10:13:26 workflow.py:2267 DEBUG Workflow finished in 1.070 seconds. [2017-06-06 10:13:27][input.scriptfilter] <?xml version="1.0" encoding="utf-8"?> <items><item valid="no"><title>Error in workflow 'com.k15t.labs.alfredapp.confluence.quicksearch'</title><subtitle>No JSON object could be decoded</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items> Thanks! Link to comment
Stefan Kleineikenscheidt Posted June 6, 2017 Author Share Posted June 6, 2017 Have you created the file ~/.alfred-confluence.json yet? If yes, please delete (or rename) and try again to use confluence_baseurl, confluence_username, and confluence_password. Hope this helps! -Stefan Link to comment
doctorwho Posted June 8, 2017 Share Posted June 8, 2017 Hi Stefan, Afraid that didn't help. This is what I tried, - there was no ~/.alfred-confluence.json created - and this error was happening- so, created ~/.alfred-confluence.json - tried again and still got same error my confluence url is of format company.jira.com/wiki, will that change anything? Link to comment
mcoppola Posted June 8, 2017 Share Posted June 8, 2017 For what it's worth, I have also tried to create the ~/.alfred-confluence.json file, to no avail. Thanks for your help, Stefan. -Matt Link to comment
Stefan Kleineikenscheidt Posted June 10, 2017 Author Share Posted June 10, 2017 (edited) Hey Doctorwho, it looks like you have configured https://mycompanyname.jira.com/wiki as Confluence Base Url, which is most probably not right. Please delete the ~/.alfred-confluence.json file and follow the step #3 from the getting started guide and make sure to use the correct Confluence Base URL. If you cannot get this to work, please create again the ~/.alfred-confluence.json file and post its contents here. -Stefan PS: Matt, I believe you experience the same issue. Pls. try to do as describe above too. Edited June 10, 2017 by Stefan Kleineikenscheidt Link to comment
doctorwho Posted June 17, 2017 Share Posted June 17, 2017 Stefan, Had configured the base_url correctly, just didn't want to enter the name of my company and so used "mycompanyname" Tried it again and got the same results. There was no ~/.alfred-confluence.json file. Attached is the contents of settings.json file from `/Users/myuser/Library/Application Support/Alfred 3/Workflow Data/com.k15t.labs.alfredapp.confluence.quicksearch/`, { "__workflow_last_version": "1.0.2", "confluence_baseUrl": "https://mycompanyname.jira.com/wiki/", "confluence_username": "shriram@mycompanyname.com" } Also, one thing, debug log for the just tried attempt shows this, Quick Search URL: https://mycompanyname.jira.com/wiki//rest/quicknav/1/search?os_authType=basic&query=tick 18:57:24 workflow.py:2243 ERROR No JSON object could be decoded The URL returned has two "/" after https://myco.....com/wiki. I typed in that URL in a browser tab and got a 404. When I typed in the URL as "https://mycompanyname.jira.com/wiki/rest/quicknav/1/search?os_authType=basic&query=tick", a .json object was returned. I had set the confluence_baseurl as: https://mycompanyname.jira.com/wiki Should I try something different? Appreciate all the help. Thanks, Shriram Link to comment
Stefan Kleineikenscheidt Posted June 20, 2017 Author Share Posted June 20, 2017 Hey Shiram, confluence_baseurl should not have a trailing slash, have you removed it? (look up /Users/myuser/Library/Application Support/Alfred 3/Workflow Data/com.k15t.labs.alfredapp.confluence.quicksearch/). It should look like this: { "__workflow_last_version": "1.0.2", "confluence_baseUrl": "https://mycompanyname.jira.com/wiki", "confluence_username": "shriram@mycompanyname.com" } Cheers, -Stefan Link to comment
Mike Ozornin Posted June 20, 2017 Share Posted June 20, 2017 Our confluence doesn't use web form authentication (login form). It uses NTLM (?) or web auth (?) with Active Directory login. I'm not strong in NTLM etc. Signin works transparently from Windows PC, from macOS with standard web auth (screenshot: http://d.mikeozornin.ru/Wuz3Mx) My settings are: { "__workflow_last_version": "1.0.2", "confluence_baseUrl": "https://wiki.ptsecurity.com", "confluence_username": "mozornin" } With these settings and my password I got 401 Unauthorized. Is it possible to use your workflow or our authentication is not supported? Link to comment
Stefan Kleineikenscheidt Posted June 20, 2017 Author Share Posted June 20, 2017 Mike, not sure how the authentication works, but I'm afraid that's beyond what I can support (if at all possible). Sorry! -Stefan Mike Ozornin 1 Link to comment
djimenez Posted June 25, 2017 Share Posted June 25, 2017 I actually dove into your script a bit, from what it looked like it wasn't ungzipping the content correctly. I could be wrong, I only spent a few minutes with it in a debugger. Link to comment
deanishe Posted June 25, 2017 Share Posted June 25, 2017 4 hours ago, djimenez said: I actually dove into your script a bit, from what it looked like it wasn't ungzipping the content correctly. I could be wrong, I only spent a few minutes with it in a debugger. Can you be more specific about that? The workflow uses my Python library, which should take care of gzip content-/transfer-encoding transparently. Stefan Kleineikenscheidt 1 Link to comment
Stefan Kleineikenscheidt Posted June 26, 2017 Author Share Posted June 26, 2017 Also, we have gzip encoding enabled on our wiki and it still works. This still looks like an authentication problem, when the actual call to the Confluence Quick Search is made. When I have some spare time, I'll add some more logging to better understand what is going on. Link to comment
wooyeong Posted July 26, 2017 Share Posted July 26, 2017 Hi stefan, I'm new to mac, learning Alfred and workflows with fun. Thanks for making the great workflow to use. I just found two issues you might be interested in. One is a simple bug, so I've posted a pull request on Github, please refer that. https://github.com/skleinei/alfred-confluence/pull/2 I found another issue during test for above PR. Alfred Confluence got 401 Unauthorized even if valid username and password are used. This is NOT the workflow's bug, but I think you may encounter support requests. If you try login attempts with wrong password more than three or more times, Confluence requires Captcha challenge. In this situation, following quicknav requests are denied with 401, you need to solve the challenge to get a result. So you need to access Confluence frontpage using web browser and answer Captcha, then Alfred Confluence would work. I just want let you know this information Thanks, wooyeong Link to comment
Kripto Posted August 17, 2017 Share Posted August 17, 2017 Doesn't work when the user is a 2FA user.. 401 unauthorized Link to comment
Corina Posted August 21, 2018 Share Posted August 21, 2018 @Stefan KleineikenscheidtI'm having the same issue with the error @doctorwho mentioned. Have you already worked it out? Looking forward, this tools looks promising! Thanks Corina Link to comment
Stefan Kleineikenscheidt Posted August 26, 2018 Author Share Posted August 26, 2018 @Corina, can you send the debug output from alfred, like doctorwho did? Are you on Confluence Cloud or Server? Btw, @all: For all the authentication issues - it seems that the alfred-confluence isn't working on Confluence Cloud these days. Cheers, -Stefan Link to comment
Corina Posted September 4, 2018 Share Posted September 4, 2018 @stefan Thanks for your reply. Find here the debug output: ```Starting debug for 'Confluence Quick Search v1.0.2' [2018-09-04 16:47:52][input.keyword] Processing output of 'action.script' with arg 'https://ofri-hq.atlassian.net/wiki' [2018-09-04 16:47:52][ERROR: action.script] 16:47:52 workflow.py:1859 DEBUG``` Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now