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

Import of data into Menas fails on Windows 10 #2129

Closed
miroslavpojer opened this issue Sep 15, 2022 · 1 comment · Fixed by #2148
Closed

Import of data into Menas fails on Windows 10 #2129

miroslavpojer opened this issue Sep 15, 2022 · 1 comment · Fixed by #2148
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation priority: low Nice to have tests QA/test-specific

Comments

@miroslavpojer
Copy link
Collaborator

Describe the bug

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

Command:

curl -v -X POST 
  "http://localhost:8080/rest_api_war/api/schema/importItem" 
  -H "@/tmp/headers.txt.G7pBq7" 
  -H "Content-Type:application/json" 
  --data @/cygdrive/ .... /data/e2e_tests/data/exports/schemas/std_nf_dy.json

Output:

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:

  1. Expected Enceladus app built and running
  2. Run script import_all.sh in your bash environment. (Clink, Cygwin)
  3. 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"

@miroslavpojer miroslavpojer added bug Something isn't working tests QA/test-specific priority: undecided Undecided priority to be assigned after discussion labels Sep 15, 2022
@miroslavpojer miroslavpojer changed the title Import of data into Menas problem on Windows 10 Import of data into Menas fail on Windows 10 Sep 15, 2022
@miroslavpojer miroslavpojer changed the title Import of data into Menas fail on Windows 10 Import of data into Menas fails on Windows 10 Sep 15, 2022
@benedeki benedeki added priority: low Nice to have documentation Improvements or additions to documentation and removed priority: undecided Undecided priority to be assigned after discussion labels Nov 1, 2022
miroslavpojer added a commit that referenced this issue Nov 7, 2022
- Added new variable to store file content before send by curl command.
miroslavpojer added a commit that referenced this issue Nov 9, 2022
- Added new variable to store file content before send by curl command.
@miroslavpojer
Copy link
Collaborator Author

Release notes:
#2129 - Added new variable to store file content before send by curl command to solved an error in windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation priority: low Nice to have tests QA/test-specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants