Closed mirimo closed 4 years ago
I also have trouble
I'm getting the same error when I do a 'pa' (set user token) and a "Invalid server response: expected value at line 1 column 1" when using 'p' (creating tags).
i've also been getting this same error trying to add a new bookmark or update the cache. my current setup has been working fine until now. don't think i've changed anything about my setup that could've caused this.
here's the debug log after running pu
.
[11:16:17.473] Logging Started...
[11:16:21.763] Rusty Pin[Keyword] Processing complete
[11:16:21.772] Rusty Pin[Keyword] Passing output '' to Junction
[11:16:21.773] Rusty Pin[Junction] Processing complete
[11:16:21.773] Rusty Pin[Junction] Passing output '' to Run Script
[11:16:23.620] STDERR: Rusty Pin[Run Script] [2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs] Parsing input arguments.
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs] Deciding on which command branch
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs] Starting in setup
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs::workflow_config] Starting in setup
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs::workflow_config] Starting in get_workflow_dirs
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs::workflow_config] cache_dir: /Volumes/Home/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs::workflow_config] data_dir: /Volumes/Home/Library/Application Support/Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs::workflow_config] Starting in read
[2020-06-17T16:16:21Z DEBUG alfred_pinboard_rs::workflow_config] Starting in get_alfred_version
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] pinb::new: calling CachedData::new
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] new: starting
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] cached_dir: "/Volumes/Home/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs"
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] create_cache_dir: starting
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] success create_cache_dir: "/Volumes/Home/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs"
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] load_cache_data_from_file: starting
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] read_cached_pins: starting
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] read_cached_tags: starting
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::cached_data] cache_ok: starting
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] pinb::new: cache not missing
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] enable_fuzzy_search: starting.
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] enable_tag_only_search: starting.
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] enable_private_new_pin: starting.
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] enable_toread_new_pin: starting.
[2020-06-17T16:16:21Z DEBUG alfred_rs::data] loading from: /Volumes/Home/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs/user.workflow.1F3CD475-7FAC-4543-A775-47DE3105B2B1-Rusty_Pin-updater.json
[2020-06-17T16:16:21Z DEBUG alfred_rs::updater] entering init
[2020-06-17T16:16:21Z DEBUG alfred_rs::updater] last check: 2020-06-17 16:14:48.105275 UTC
[2020-06-17T16:16:21Z DEBUG alfred_rs::updater] calling read_last_check_status
[2020-06-17T16:16:21Z DEBUG alfred_rs::data] loading from: /Volumes/Home/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs/last_check_status_async.json
[2020-06-17T16:16:21Z DEBUG alfred_rs::updater] read last_check_status: UpdateInfo { version: Version { major: 0, minor: 15, patch: 12, pre: [], build: [] }, fetched_at: Some(2020-06-17T16:14:48.105275Z), downloadable_url: "https://github.com/spamwax/alfred-pinboard-rs/releases/download/0.15.12/alfred-pinboard-rust-0.15.12.alfredworkflow", _priv: () }
[2020-06-17T16:16:21Z DEBUG alfred_rs::updater] status: Ok(None)
[2020-06-17T16:16:21Z DEBUG alfred_rs::updater] successfully set the state of release worker
[2020-06-17T16:16:21Z INFO alfred_pinboard_rs::commands::update] Starting in update_cache
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard] is_cache_outdated: starting.
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::api] recent_update: starting.
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::api] get_api_response: starting.
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::api] url: "https://api.pinboard.in/v1/posts/update"
[2020-06-17T16:16:21Z DEBUG rusty_pin::pinboard::api] add_auth_token: starting.
[2020-06-17T16:16:23Z DEBUG rusty_pin::pinboard::api] resp is ok (no error)
[2020-06-17T16:16:23Z DEBUG rusty_pin::pinboard::api] string from resp ok
[2020-06-17T16:16:23Z DEBUG rusty_pin::pinboard::api] ['\u{feff}', '{', '\"', 'u', 'p', 'd', 'a', 't', 'e', '_']
[11:16:23.644] Rusty Pin[Run Script] Processing complete
[11:16:23.645] Rusty Pin[Run Script] Passing output 'Error: serde error: expected value at line 1 column 1
' to Junction
[11:16:23.646] Rusty Pin[Junction] Processing complete
[11:16:23.647] Rusty Pin[Junction] Passing output 'Error: serde error: expected value at line 1 column 1
' to Filter
[11:16:23.648] Rusty Pin[Filter] Processing complete
[11:16:23.648] Rusty Pin[Filter] Passing output 'Error: serde error: expected value at line 1 column 1
' to Large Type
[11:16:23.649] Rusty Pin[Junction] Passing output 'Error: serde error: expected value at line 1 column 1
' to Filter
I get the same error.
Samesies
Same issue.
Same. Noticed it earlier this week.
Suspect it's this: https://twitter.com/nnnnicholas/status/1274067020011765765?s=20
If anyone else is having Pinboard API problems since June 14, I added this snippet inside the HTTP response handler and it fixed my program:
if (http://response.data.charCodeAt(0) === 0xFEFF) { http://response.data = JSON.parse(http://response.data.slice(1)); }
That's a temp fix while Pinboard chases down the bug:
Pinboard @Pinboard · 13h It looks like a byte order mark is getting added. Try stripping whitespace around the JSON response before parsing. Meanwhile I'm trying to chase down the bug (this happened after a major server upgrade)
https://twitter.com/Pinboard/status/1274055573902774272?s=20
Same issue
I also have the same issue
Maciej/Pinboard reporting that he’s solved the underlying issue for this i think?
The BOM issue has indeed been solved (and I tested it too), see this tweet. But I still have an issue caused by something else:
[2020-07-02T11:10:36Z DEBUG rusty_pin::pinboard::api] tags_frequency: starting.
[2020-07-02T11:10:36Z DEBUG rusty_pin::pinboard::api] get_api_response: starting.
[2020-07-02T11:10:36Z DEBUG rusty_pin::pinboard::api] url: "https://api.pinboard.in/v1/tags/get"
[2020-07-02T11:10:36Z DEBUG rusty_pin::pinboard::api] add_auth_token: starting.
[2020-07-02T11:10:37Z DEBUG rusty_pin::pinboard::api] resp is ok (no error)
[2020-07-02T11:10:37Z DEBUG rusty_pin::pinboard::api] string from resp ok
[2020-07-02T11:10:37Z DEBUG rusty_pin::pinboard::api] ['{', '\"', '0', 'm', 'q', '\"', ':', '1', ',', '\"']
[2020-07-02T11:10:37Z DEBUG rusty_pin::pinboard::api] trying to decode non-object empty tag list
[2020-07-02T11:10:37Z DEBUG alfred_pinboard_rs] Starting in show_error_alfred
[13:10:37.439] Rusty Pin[Script Filter] {"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"invalid type: map, expected a sequence at line 1 column 0","title":"Error"}]}
I queried this endpoint manually and the output seems fine so I'm not sure what's going on.
I ran: λ> http 'https://api.pinboard.in/v1/tags/get?auth_token=pyrho:DONTPUTYOURAPITOKENHERE&format=json' | jq .
@pyrho are you still getting the error? is issue resolved for rest of you after pinboard's fix?
I still get this when refreshing:
[13:14:51.042] Rusty Pin[Run Script] Passing output '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"invalid type: map, expected a sequence at line 1 column 0","title":"Error"}]}
Since Maciej apparently fixed the bug, I tried deleting the workflow and reinstalling a newly downloaded version from Releases, but that led to the same state.
@pyrho are you still getting the error?
Yes.
is issue resolved for rest of you after pinboard's fix?
No.
ps: thanks for the edit above :X
I'm seeing the same error as @pyrho, even after deleting and installing again. It looks like the error is happening here: https://github.com/spamwax/rusty-pin/blob/1e3e64846abd26f0f19a151c367b2be408f4c45f/src/pinboard/api.rs#L195-L217
serde
expects a map and for some reason pinboard's API is not providing valid data.
does this only happen when you have tag suggestion feature turned on?
does this only happen when you have tag suggestion feature turned on? When I turned off the tag suggestion feature, I pinned a page to my board, but I failed at the second time.
@spamwax Can you not replicate this? I have CLion and rust installed, so I can help you debug it if you need more info. What I don't have is a lot of rust experience...
Another strange thing I noticed is that the workflow seems to make API calls to https://api.pinboard.in/v1/tags/get
even when it's not needed. For example, I deleted the workflow, including deleting the files in Library/Application Support/Alfred/Workflow Data\cc.hamid.alfred-pinboard-rs
and /Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs
, and then reinstalled it. The first thing I did was pconf
, and when I go to Click to check for Workflow updates
, I get the same error invalid type: map, expected a sequence at line 1 column 0
because the workflow is calling that function in rusty-pin
that parses the tags.
Why does the workflow need to fetch tags to check for workflow updates?
What's even more strange is that the API call succeeded to get my tags, even though I did not set the API token yet. How did the workflow know which token to use? Is there another file the workflow uses that's not in Library/Application Support/Alfred
or Library/Caches/com.runningwithcrayons.Alfred
?
Never mind the last comment about the token. I had the old Golang version of the workflow still in the Alfred Application Support, and that's where it found the token. After I deleted that and reinstalled, I confirmed that pconf
doesn't work until you set the token.
Using Ruby to inspect the contents of the body in the tags GET request, I noticed a \t
at the end of the closing bracket. For example:
"{\"rust\":1,\"golang\":1}\t"
I don't think that \t
is supposed to be there. Ruby is able to parse the JSON just fine, but perhaps what rusty-pin
is doing is causing it to throw an error.
I think I figured out the issue. The tags frequency test in rusty-pin
is using a mock JSON response that uses strings for the tag frequency: https://github.com/spamwax/rusty-pin/blob/master/tests/all_tags_mockito.json. For example:
{
"tag1": "1",
"tag2": "1"
}
However, the Pinboard API response uses integers for the frequency. This is what is causing the error invalid type: map, expected a sequence at line 1 column 0
. I verified this by cloning the rusty-pin
repo and changing the mock response to use integers instead of strings. I wonder if this is something that changed in the Pinboard API. I will ask Maciej.
Either way, I think rusty-pin
should be more resilient and be able to work with either strings or integers. Thoughts, @spamwax?
Could be a change in serde, then? Even a bug...
I don't mean to be a pest, but this has broken my bookmarks flow, and I now have to use the pinboard website every time I have to go to a website I can't remember the address for. Is this bug/change easy to fix/work around? If not, I have to find another way to access pinboard.
I've been using https://github.com/vitorgalvao/pinplus, it does the job.
Sad that I've had to go back to PinPlus as I really did prefer Rusty Pin.
OK, I've replicated the issue by making all tag frequency numbers into numbers instead of strings. Trying to make a PR now.
Edit: PR
Here are instructions that worked for me for those of you who want to be able to keep using this workflow right away:
rusty-pin
repo, make the same changes as in this PR: https://github.com/spamwax/rusty-pin/pull/6/filesalfred-pinboard-rs
repo, make the following changes to Cargo.toml
:
a. Update the version on line 3 to "0.15.13"
b. Replace lines 24 and 25 (git and branch) with the path to your local rusty-pin
repo:. For example, path = "/Users/monfresh/projects/rusty-pin"
create_alfred_workflow.sh
so that it would only build the workflow locally. You can copy and paste what I did, but make sure to change line 13 to point to your local alfred-pinboard-rs
repo
#!/bin/bash
version_tag=$1 msg=$2 push_it=$3
if [ -z "$version_tag" ]; then echo "You need to provide a semver tag: v0.9.10" exit fi
alfred_pinboard_rs="/Users/moncef/projects/monfresh/alfred-pinboard-rs"
res_dir="$alfred_pinboard_rs/res/workflow"
git checkout master || exit
echo "Building new release..." cd "$alfred_pinboard_rs" || exit
cargo build --release > build.log 2>&1
echo "Copying executable to workflow's folder..." strip target/release/alfred-pinboard-rs cp target/release/alfred-pinboard-rs "$res_dir"
echo "Updating version in info.plist"
defaults write "$res_dir"/info.plist version "$version_tag" plutil -convert xml1 "$res_dir"/info.plist
echo "Creating the workflow bundle..." rm -f AlfredPinboardRust.alfredworkflow cd "$res_dir" || exit rm -f AlfredPinboardRust.alfredworkflow
zip -r AlfredPinboardRust.alfredworkflow ./*
6. Run `cargo build`
7. Run `$(which bash) create_alfred_workflow.sh 0.15.13`
8. In your local `alfred-pinboard-rs` directory, go to `res/workflow`, then double-click on `AlfredPinboardRust.alfredworkflow`. That should install it in your Alfred, and everything should be working fine now.
Thanks @monfresh, worked like a charm for me and I'm not getting the error in #83.
Thank you all for your patience and contributions. API was changed without notice and update to its documentation. This issue will be fixed by the end of tomorrow when I get back to my cave.
Later release is being built on CircleCI and should be finished soon. Please update the workflow by directly downloading from the release page here as the error in this issue may prevent the builtin auto-update. Please report back or open new issue if still experiencing problems.
closing as it seems issue is fixed now.
Hi I'm trying to go through the first configuration without success. I am probably making a simple mistake..? Pinoboard API token is valid (to be sure I generated a new one) and I have only one bookmark on my pinboard account. MacOS 10.15.5 + Alfred 4.0.9_1144
[12:34:41.760] Logging Started... [12:34:49.998] Rusty Pin[Keyword] Processing complete [12:34:49.998] Rusty Pin[Keyword] Passing output 'm:4' to Run Script [12:34:50.013] STDERR: Rusty Pin[Run Script] [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs] Parsing input arguments. [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs] Deciding on which command branch [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::commands::config] Starting in run [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in setup [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in get_workflow_dirs [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] cache_dir: /Users/jonasz/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] data_dir: /Users/jonasz/Library/Application Support/Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in read [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in get_alfred_version [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in save [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::commands::config] Saved new configs to settings.json in: /Users/jonasz/Library/Application Support/Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs [12:34:50.015] Rusty Pin[Run Script] Processing complete [12:34:50.016] Rusty Pin[Run Script] Passing output 'Successfully set user credentials. ' to Conditional [12:34:50.016] Rusty Pin[Conditional] Processing complete [12:34:50.017] Rusty Pin[Conditional] Passing output 'Successfully set user credentials. ' to Run Script [12:34:50.872] STDERR: Rusty Pin[Run Script] [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs] Parsing input arguments. [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs] Deciding on which command branch [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs] Starting in setup [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in setup [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in get_workflow_dirs [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] cache_dir: /Users/jonasz/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] data_dir: /Users/jonasz/Library/Application Support/Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in read [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs::workflow_config] Starting in get_alfred_version [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard] pinb::new: calling CachedData::new [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] new: starting [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] cached_dir: "/Users/jonasz/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs" [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] create_cache_dir: starting [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] success create_cache_dir: "/Users/jonasz/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cc.hamid.alfred-pinboard-rs" [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] load_cache_data_from_file: starting [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] cache_ok: starting [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard] pinb::new: cache file missing, calling update [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::cached_data] update_cache: starting [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] all_pins: starting. [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] get_api_response: starting. [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] url: "https://api.pinboard.in/v1/posts/all" [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] add_auth_token: starting. [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] resp is ok (no error) [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] string from resp ok [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] ['\u{feff}', '[', '{', '\"', 'h', 'r', 'e', 'f', '\"', ':'] [2020-06-16T10:34:50Z DEBUG rusty_pin::pinboard::api] received all bookmarks [2020-06-16T10:34:50Z DEBUG alfred_pinboard_rs] Starting in show_error_alfred [12:34:50.881] Rusty Pin[Run Script] Processing complete [12:34:50.882] Rusty Pin[Run Script] Passing output '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1 column 1","title":"Error"}]} ' to Junction [12:34:50.883] Rusty Pin[Junction] Processing complete [12:34:50.884] Rusty Pin[Junction] Passing output '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1 column 1","title":"Error"}]} ' to Filter [12:34:50.884] Rusty Pin[Junction] Passing output '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1 column 1","title":"Error"}]} ' to Filter [12:34:50.885] Rusty Pin[Filter] Processing complete [12:34:50.886] Rusty Pin[Filter] Passing output '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1 column 1","title":"Error"}]} ' to Post Notification