Closed almereyda closed 3 years ago
Hmm, this happens when either the username or the Hypothesis group ID can't be found. Since the authorize
command worked, it seems to be the group ID that's causing the issue. How did you create/select the group?
I took another look - could you let me know which version of gooseberry you're running? On the latest v0.6.0 this line of code is not touched by any of the commands listed in the "To Reproduce" section, so I'm a bit mystified now!
Heya, I'm experiencing the (seemingly) same problem. Using latest precompiled binary on Ubuntu 20.04
gooseberry sync
Error:
0: Make sure input fields are valid
1: Status:
Reason:
Location:
/home/runner/work/gooseberry/gooseberry/src/gooseberry/mod.rs:126
I'm very excited in advance by Gooseberry, so I'd be glad to help you solve this. Cheers
How did you create/select the group?
I used your dialoguer interface, which stored hypothesis_group = 'VEeoyDkE'
in the config file.
When I replaced the group id by the group name, i.e. hypothesis_group = 'ngirard'
, no error was reported during the sync:
gooseberry sync
Done!
Everything up to date!
but the resulting database seems empty, judging by the output of gooseberry search
.
Hope that helps
Hi, thanks for reaching out! I believe the problem here is that you're using the group name instead of the ID. The ID is the <code>
part in the group URL: https://hypothes.is/groups/<code>/<name>
. Another easier option is to run gooseberry config group
and then select the "Use an existing Hypothesis group" option, it should list all your groups along with their IDs there and you can select the one you want.
Thanks for your feedback.
I believe the problem here is that you're using the group name instead of the ID. (...)
Unfortunately, that's what I did in the first place. This leads to the error which OP reported and I'm experiencing.
Ah I see, sorry for the misunderstanding! Hmm, then indeed it seems like there's something going wrong with the Hypothesis call. Do you think you could clone the repo and run with backtrace? Also, does it only fail with this group? (for e.g if you create a new group and add an annotation there does the sync work?)
Alright, so creating a new group and annotating into it worked fine.
Here's your backtrace:
RUST_BACKTRACE=1 /home/ngirard/soft/gooseberry.git.git/target/debug/gooseberry sync
Error:
0: Make sure input fields are valid
1: Status:
Reason:
Location:
/home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:126
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: color_eyre::config::EyreHook::default::h39a8a16bab443ec5
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/color-eyre-0.5.10/src/config.rs:1016
2: color_eyre::config::EyreHook::into_eyre_hook::{{closure}}::h963abafd467e63f6
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/color-eyre-0.5.10/src/config.rs:1070
3: eyre::capture_handler::h42552ffa394ea914
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.5/src/lib.rs:551
4: eyre::error::<impl eyre::Report>::from_std::h97ff5b653810ceee
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.5/src/error.rs:90
5: eyre::error::<impl core::convert::From<E> for eyre::Report>::from::hda66eece24228332
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.5/src/error.rs:464
6: gooseberry::gooseberry::Gooseberry::sync::{{closure}}::h87630861eca82208
at /home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:126
7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h8d3b0f5ae982d0c8
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
8: gooseberry::gooseberry::Gooseberry::run::{{closure}}::h78c45f41d877ab88
at /home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:76
9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h99ebc36d09450fd1
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
10: gooseberry::gooseberry::Gooseberry::start::{{closure}}::h1fbdbc3586a80ffa
at /home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:69
11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hfaedb37eed8fdda3
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
12: gooseberry::main::{{closure}}::h43ad353beddc155e
at /home/ngirard/soft/gooseberry.git.git/src/main.rs:12
13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h44d9fae1883c0494
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
14: tokio::park::thread::CachedParkThread::block_on::{{closure}}::h69037d85255f46ce
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/park/thread.rs:263
15: tokio::coop::with_budget::{{closure}}::h2771a91be4e4e07c
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/coop.rs:106
16: std::thread::local::LocalKey<T>::try_with::he98e8df5219a720d
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272
17: std::thread::local::LocalKey<T>::with::he2c435ca27ec6e3d
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:248
18: tokio::coop::with_budget::h9ac9f06d103e5597
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/coop.rs:99
19: tokio::coop::budget::h50b2d7e3983a686f
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/coop.rs:76
20: tokio::park::thread::CachedParkThread::block_on::h6a4f5b578d4091b4
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/park/thread.rs:263
21: tokio::runtime::enter::Enter::block_on::h8cbcb8c5966c23ac
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/runtime/enter.rs:151
22: tokio::runtime::thread_pool::ThreadPool::block_on::h07eb11ad4077d372
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/runtime/thread_pool/mod.rs:71
23: tokio::runtime::Runtime::block_on::h1639fabaf649b6c4
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/runtime/mod.rs:452
24: gooseberry::main::h08aebbe651464277
at /home/ngirard/soft/gooseberry.git.git/src/main.rs:6
25: core::ops::function::FnOnce::call_once::h5382d4da34be7663
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
26: std::sys_common::backtrace::__rust_begin_short_backtrace::hbc865c9e88802db5
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125
27: std::rt::lang_start::{{closure}}::h5e0ac3460cf843c2
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66
28: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h78040f802d89ccdc
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:259
29: std::panicking::try::do_call::h6853cad536dd09a1
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:379
30: std::panicking::try::h827495f03a9fbb9a
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:343
31: std::panic::catch_unwind::h4bdf17571090eb17
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panic.rs:396
32: std::rt::lang_start_internal::h2f319c33bb013f29
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:51
33: std::rt::lang_start::h3ece3ab7c6568856
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65
34: main<unknown>
at <unknown source file>:<unknown line>
35: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
36: _start<unknown>
at <unknown source file>:<unknown line>
I'm trying to figure out what could be special about this group to cause the issue. The search that gooseberry does with the hypothesis API is hypothesis annotations search --user "acct:<username>@hypothes.is" --group "<group_id>" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc
. Would you be up for grabbing the binary from here and trying this command? You'd have to set the HYPOTHESIS_NAME and HYPOTHESIS_KEY environment variables to get it to run.
Sure.
So , should I both put my username into HYPOTHESIS_NAME
and replace <username>
with it in your command ?
Here's the result:
hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --group "VEeoyDkE" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order ascError:
0: Make sure input fields are valid
1: Status:
Reason:
Location:
/home/runner/work/rust-hypothesis/rust-hypothesis/src/cli.rs:226
Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
RUST_BACKTRACE=full hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --group "VEeoyDkE" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc
Error:
0: Make sure input fields are valid
1: Status:
Reason:
Location:
/home/runner/work/rust-hypothesis/rust-hypothesis/src/cli.rs:226
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Very confusing!
Okay, one last idea - could you search for your group on https://jonudell.info/h/facet/ and see if it comes through without errors?
I'm afraid it doesn't appear -- unless I'm misusing that tool.
Even after adding the API token? There should be an option to add it near the bottom of the page
Choosing the "public" group doesn't make it work any better
❯ /home/ngirard/soft/gooseberry.git.git/target/debug/gooseberry config group
✔ Where should gooseberry take annotations from? · Use an existing Hypothesis group
✔ Which group should gooseberry use? · __world__: Public
~/soft via ☕ v11.0.10 took 6s
❯ RUST_BACKTRACE=1 /home/ngirard/soft/gooseberry.git.git/target/debug/gooseberry sync
Error:
0: Make sure input fields are valid
1: Status:
Reason:
Location:
/home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:126
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: color_eyre::config::EyreHook::default::h39a8a16bab443ec5
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/color-eyre-0.5.10/src/config.rs:1016
2: color_eyre::config::EyreHook::into_eyre_hook::{{closure}}::h963abafd467e63f6
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/color-eyre-0.5.10/src/config.rs:1070
3: eyre::capture_handler::h42552ffa394ea914
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.5/src/lib.rs:551
4: eyre::error::<impl eyre::Report>::from_std::h97ff5b653810ceee
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.5/src/error.rs:90
5: eyre::error::<impl core::convert::From<E> for eyre::Report>::from::hda66eece24228332
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.5/src/error.rs:464
6: gooseberry::gooseberry::Gooseberry::sync::{{closure}}::h87630861eca82208
at /home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:126
7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h8d3b0f5ae982d0c8
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
8: gooseberry::gooseberry::Gooseberry::run::{{closure}}::h78c45f41d877ab88
at /home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:76
9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h99ebc36d09450fd1
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
10: gooseberry::gooseberry::Gooseberry::start::{{closure}}::h1fbdbc3586a80ffa
at /home/ngirard/soft/gooseberry.git.git/src/gooseberry/mod.rs:69
11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hfaedb37eed8fdda3
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
12: gooseberry::main::{{closure}}::h43ad353beddc155e
at /home/ngirard/soft/gooseberry.git.git/src/main.rs:12
13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h44d9fae1883c0494
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
14: tokio::park::thread::CachedParkThread::block_on::{{closure}}::h69037d85255f46ce
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/park/thread.rs:263
15: tokio::coop::with_budget::{{closure}}::h2771a91be4e4e07c
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/coop.rs:106
16: std::thread::local::LocalKey<T>::try_with::he98e8df5219a720d
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272
17: std::thread::local::LocalKey<T>::with::he2c435ca27ec6e3d
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:248
18: tokio::coop::with_budget::h9ac9f06d103e5597
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/coop.rs:99
19: tokio::coop::budget::h50b2d7e3983a686f
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/coop.rs:76
20: tokio::park::thread::CachedParkThread::block_on::h6a4f5b578d4091b4
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/park/thread.rs:263
21: tokio::runtime::enter::Enter::block_on::h8cbcb8c5966c23ac
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/runtime/enter.rs:151
22: tokio::runtime::thread_pool::ThreadPool::block_on::h07eb11ad4077d372
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/runtime/thread_pool/mod.rs:71
23: tokio::runtime::Runtime::block_on::h1639fabaf649b6c4
at /home/ngirard/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.4.0/src/runtime/mod.rs:452
24: gooseberry::main::h08aebbe651464277
at /home/ngirard/soft/gooseberry.git.git/src/main.rs:6
25: core::ops::function::FnOnce::call_once::h5382d4da34be7663
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
26: std::sys_common::backtrace::__rust_begin_short_backtrace::hbc865c9e88802db5
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125
27: std::rt::lang_start::{{closure}}::h5e0ac3460cf843c2
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66
28: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h78040f802d89ccdc
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:259
29: std::panicking::try::do_call::h6853cad536dd09a1
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:379
30: std::panicking::try::h827495f03a9fbb9a
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:343
31: std::panic::catch_unwind::h4bdf17571090eb17
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panic.rs:396
32: std::rt::lang_start_internal::h2f319c33bb013f29
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:51
33: std::rt::lang_start::h3ece3ab7c6568856
at /home/ngirard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65
34: main<unknown>
at <unknown source file>:<unknown line>
35: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
36: _start<unknown>
at <unknown source file>:<unknown line>
Oh! That adds some more information. Could you try hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc
? (i.e. without the group)
Even after adding the API token? There should be an option to add it near the bottom of the page
Dit it. No luck.
Could you try
hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc
? (i.e. without the group)
There you are
RUST_BACKTRACE=full hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc
Error:
0: Make sure input fields are valid
1: Status:
Reason:
Location:
/home/runner/work/rust-hypothesis/rust-hypothesis/src/cli.rs:226
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
Okay! This possibly means that the authorization didn't work at all since this is my output for the same command:
hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc
{"id":"AVRynMV8FtPwhMO7DdSv","created":"2016-05-02T17:55:57.436225Z","updated":"2016-05-02T17:55:57.436237Z","user":"acct:Nicolas_Girard@hypothes.is","uri":"http://dansheffler.com/pdfs/A-Complex-Eternity.pdf","text":"public","tags":[],"group":"__world__","permissions":{"read":["group:__world__"],"delete":["acct:Nicolas_Girard@hypothes.is"],"admin":["acct:Nicolas_Girard@hypothes.is"],"update":["acct:Nicolas_Girard@hypothes.is"]},"target":[{"source":"http://dansheffler.com/pdfs/A-Complex-Eternity.pdf","selector":[{"type":"TextPositionSelector","start":129,"end":162},{"type":"TextQuoteSelector","exact":" the contemporary discussion, the","prefix":"tionship betweenGod and time. In","suffix":" issue is framed between the two"}]}],"links":{"html":"https://hypothes.is/a/AVRynMV8FtPwhMO7DdSv","incontext":"https://hyp.is/AVRynMV8FtPwhMO7DdSv/dansheffler.com/pdfs/A-Complex-Eternity.pdf","json":"https://hypothes.is/api/annotations/AVRynMV8FtPwhMO7DdSv"},"hidden":false,"flagged":false,"references":[],"user_info":{"display_name":null}}
I'm going to search through the official hypothesis API issues to see if this has happened before
Great, thanks in advance !
Is it worth compiling your hypothesis cli and running it with RUST_BACKTRACE=full
?
No, I don't think so as it's failing while parsing the JSON output returned by Hypothesis. One option would be to add a print just above the line and inspect the raw output.
Alright, could you point me to the right line, please ?
That would be line 406 in hypothesis/src/lib.rs
- and the variable is text
, (i.e.println!("{:?}", text)
)
There you are.
../target/debug/hypothesis annotations search --user "acct:Nicolas_Girard@hypothes.is" --search-after "1900-01-01T00:00:00.000Z" --offset 0 --limit 200 --sort updated --order asc > out
Just let me know if I need to reset my API key afterwards.
Thank you, this is perfect! I'll attempt parsing each annotation with the library and see which one breaks the parser.
@ngirard I believe this should be fixed now on the main branch, the issue was that Hypothesis is now using more w3 selectors than I was aware of. Could you try pulling the changes and seeing if everything works? If it does, I'll release a new version.
Just let me know if I need to reset my API key afterwards.
The key isn't exported with the annotations so no need for this
Yup, working like a charm ! Nice work !
How about turning that println
into a debug printout, just in case ?
How about turning that
println
into a debug printout, just in case ?
Good idea, I'll add it to the error message so it's less cryptic. Glad it's working, thanks for the help! I'll make a new release
Added the above fix to the new release (v0.8.0) so I'm closing this issue. @almereyda if your issue is still not fixed please reopen.
Bug description
When trying to synchronise the local knowledge base, an error is thrown:
To Reproduce
goosebery config authorize
goosebery config kb all
gooseberry sync
Expected behavior
The
sync
is performed and a subsequentmake
run can finish.