Upload of json data files failing on curl command when opening json file. Used prepared script import_all.sh
Problem in curl parameter -d when defined path to file using @<path>.
Warning: Couldn't read data from file
Warning: "/cygdrive/c/Users/ab024LL/absa/git/enceladus/examples/data/e2e_tests/
Warning: data/exports/datasets/uppercaseConfrormanceRule.json", this makes an
Warning: empty POST.
...
Required request body is missing: ....
To Reproduce
Steps to reproduce the behavior OR commands run:
Expected Enceladus app built and running
Run script import_all.sh in your bash environment. (Clink, Cygwin)
Problem occurs, no data imported.
Expected behavior
No error message visible. All data files imported in Menas DB.
Desktop (please complete the following information):
OS: Windows 10 Enterprise 21H2 19044.1889
Clink 0.4.0 with curl 7.83.1
Cygwin with curl 7.83.1
Additional context
Proposal to repair:
for var in `ls -d ${PWD}/${1}/*`; do
canonicalPath=$(realpath "${var}")
fileContent=`cat ${canonicalPath}` -- new variable
curl -v \
-H "@${HEADERS_FILE}" \
-H 'Content-Type:application/json' \
--data "${fileContent}" \ -- usage of variable, no @ used
"${URL}/api/${2}/importItem"
Describe the bug
Upload of json data files failing on
curl
command when opening json file. Used prepared scriptimport_all.sh
Problem incurl
parameter-d
when defined path to file using@<path>
.Command:
Output:
To Reproduce
Steps to reproduce the behavior OR commands run:
import_all.sh
in your bash environment. (Clink, Cygwin)Expected behavior
No error message visible. All data files imported in Menas DB.
Desktop (please complete the following information):
Additional context
Proposal to repair: