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

jq: error (at <stdin>:1): Cannot iterate over null (null) #32

Closed
nb2001c opened this issue Dec 13, 2022 · 5 comments
Closed

jq: error (at <stdin>:1): Cannot iterate over null (null) #32

nb2001c opened this issue Dec 13, 2022 · 5 comments

Comments

@nb2001c
Copy link

nb2001c commented Dec 13, 2022

Hello,
On Dec 9 2022 it was working perfectly.
Starting on 10 Dec 2022 it didn't work. The output error is regarding jq:

Please wait connecting!
Connection to API

API login to server OK
Username & Password accepted by Huawei Server
Normal Status
jq: error (at :1): Cannot iterate over null (null)

ndefined Error
\nReturned data:

What is wrong?
Thank you!

@januweness
Copy link
Collaborator

januweness commented Dec 13, 2022 via email

@nb2001c
Copy link
Author

nb2001c commented Dec 13, 2022

Modified line 1002 in function.sh. Unfortunately the same error.
I assume that the problem is somewhere elsewhere.
Looking forward for your help.
Thank you!

@nb2001c
Copy link
Author

nb2001c commented Dec 15, 2022

Hello,

I uncomment line 1043:
echo "XSRF-TOKEN: "$xsrf_token

The result is:
XSRF-TOKEN: XSRF-TOKEN=x-g45g44hgtidfcbdjvv9d5ivtiqk51frvpdql7u89mqg4qkk5k9qknw9j4b1hjusb8ailmkmo5ebt075i89kb5gnw059gjvfvirfx2rs5heqodeeqg5im2neonvupbv05

So, the problem is the variable xrsf_token still contain teh string "XSRF-TOKEN="

I added into function.sh a new line just before line 1040 which is: xsrf_token=$(echo $xsrf_token). The new line will subtract only the token:

xsrf_token=$(awk '{print substr($0, 13, 200)}' <<< $xsrf_token)

After this small change, the script is working again!

I'm not a good programmer in bash so please don't blame me so much.
I hope you can adjust the code in a professional way.
Looking for a new software version.

Thank you so much!

@BlazejosP
Copy link
Owner

BlazejosP commented Jan 28, 2023

I also repaired login into service so now XLRF-token is accepted again and look that you can use service. Like usually Huawei changes small things related to token answer from API without warning and now that was on different potion in our array. Check update in functions.sh

@BlazejosP
Copy link
Owner

Hope that solved problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants