Jump to content

Recommended Posts

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:

 

I've tested with Alfred 3 and on macOS Sierra. Hope you find it useful.

 

Cheers,
-Stefan

Edited by Stefan Kleineikenscheidt
Link to comment
  • 4 weeks later...

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

Screen Shot 2017-05-16 at 2.26.23 PM.png

Link to comment
  • 2 weeks later...
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

Screen Shot 2017-05-16 at 2.26.23 PM.png


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

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

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

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 by Stefan Kleineikenscheidt
Link to comment

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

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

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

Link to comment
  • 1 month later...

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
  • 4 weeks later...
  • 1 year later...
  • 2 weeks later...

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...