Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_data_to_graph.sh errors out for older versions of curl #213

Closed
1 of 3 tasks
Tracked by #8
alyssadai opened this issue Nov 6, 2023 · 0 comments · Fixed by #227
Closed
1 of 3 tasks
Tracked by #8

add_data_to_graph.sh errors out for older versions of curl #213

alyssadai opened this issue Nov 6, 2023 · 0 comments · Fixed by #227
Assignees
Labels
type:bug Defects in shipped code and fixes for those defects

Comments

@alyssadai
Copy link
Contributor

alyssadai commented Nov 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

For JSONLD data in specified directory to be successfully added to the graph without errors.

Current Behavior

curl error resulting in data not being added (confirmed by checking triple count in database).

Error message

(base) alyssayd@ducky:~/alyssa/projects/api$ ./add_data_to_graph.sh /data/origami/neurobagel_graph_data/ppmi 2
06.12.89.194:7200 repositories/mni_ppmi $NB_GRAPH_USERNAME $NB_GRAPH_PASSWORD --use-graphdb-syntax

UPLOADING DATA FROM /data/origami/neurobagel_graph_data/ppmi TO repositories/mni_ppmi...

ppmi.jsonld:
curl: option --no-progress-meter: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
./add_data_to_graph.sh: line 185: ((: < 200 ||  >= 300 : syntax error: operand expected (error token is "< 200
 ||  >= 300 ")


FINISHED UPLOADING DATA FROM /data/origami/neurobagel_graph_data/ppmi TO repositories/mni_ppmi.

Environment

  • curl version: 7.58.0 (x86_64-pc-linux-gnu)

How to reproduce

No response

Anything else?

According to the curl docs, --no-progress-meter was added in 7.67.0, while shared data servers like the BIC may have older versions of the tool.

An alternative to suppress the progress meter while still showing the response headers may be replace --show-progress-meter with a combination of the following arguments:

-s / --silent
-S / --show-error

How do we fix it

  • document dependency on curl version in public docs
  • sanity check in the upload.sh script for curl --version

here is a helpful little snippet, courtesy of gtp:

curl_version="$(curl --version | grep curl | awk '{print $2}' | cut -d'-' -f1)"

if [[ "$curl_version" < "7.67.0" ]]; then
  echo "error"
elif [[ "$curl_version" > "7.67.0" ]]; then
  echo "success"
fi
@alyssadai alyssadai added the type:bug Defects in shipped code and fixes for those defects label Nov 6, 2023
@surchs surchs added this to Neurobagel Nov 6, 2023
@alyssadai alyssadai added the flag:schedule Flag issue that should go on the roadmap or backlog. label Nov 6, 2023
@alyssadai alyssadai changed the title add_data_to_graph.sh add_data_to_graph.sh errors out for older versions of curl Nov 6, 2023
@alyssadai alyssadai moved this to Backlog in Neurobagel Nov 6, 2023
@alyssadai alyssadai removed the flag:schedule Flag issue that should go on the roadmap or backlog. label Nov 6, 2023
@surchs surchs moved this from Backlog to Specify - Active in Neurobagel Nov 16, 2023
@alyssadai alyssadai moved this from Specify - Active to Specify - Done in Neurobagel Nov 16, 2023
@alyssadai alyssadai moved this from Specify - Done to Backlog in Neurobagel Nov 16, 2023
@surchs surchs moved this from Backlog to Specify - Active in Neurobagel Nov 21, 2023
@surchs surchs moved this from Specify - Active to Specify - Done in Neurobagel Nov 23, 2023
@surchs surchs moved this from Specify - Done to Implement - Active in Neurobagel Nov 23, 2023
@surchs surchs self-assigned this Nov 23, 2023
@surchs surchs moved this from Implement - Active to Implement - Done in Neurobagel Nov 23, 2023
@alyssadai alyssadai moved this from Implement - Done to Review - Active in Neurobagel Nov 23, 2023
@github-project-automation github-project-automation bot moved this from Review - Active to Review - Done in Neurobagel Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Defects in shipped code and fixes for those defects
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants