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
Batch Csrf token error #617
Comments
Hi @d-sooter , We'll try to reproduce it on our side and get back to you ASAP. Can you share the code snippet that fails and the SDK version you use? cc @marikaner Best, |
Hey @d-sooter , do you mean that there is an internal request that fails without body or are you executing it on your own? An actual error message would be very helpful to understand what is going wrong. |
Hi Guys sorry i was not able to answer sooner. Enviroment: SAP Business application Studio OData service version: V2 Coding:
` Error Stack As far as i can tell it happens because the Get request to retrieve the x-csrf-token returns an empty body as the call is not made to any entity set but rather the entity root itself. With in itself doesnt return a body. This causes the request to return an empty body and breaks the processing. I hope this helps if you need anything else let me know. |
Hey @d-sooter, there should be another "Caused by" following the logs that you sent. Can you check this as well? It could give us some insight why this is failing. I think the problem is not that we do not handle empty responses, but the CSRF request that we make has no headers. You are right, we are executing the CSRF fetch against the service url (e. g. |
Hey @marikaner , getting the CSRF token manually works. I was able to do it when calling the service url. i think in general fetching a token again the service url is not wrong. But the framework seems to have issues when the body is empty. ( as far as i can tell) here is the stack once again thats all im getting in the catch. if i get the token myself and pass it as a header then the system says its invalid. Kind regards David |
Thanks David, we are investigating this. The log statement that I was looking for cannot be present in your logs, because we only added it last week and it is not yet released. I missed that. |
Hey @d-sooter, I think I am getting closer to the problem. Do you have a possibility to try fetching the CSRF token from |
Hey @d-sooter, Good news! I found the issue - it is related to an issue in the underlying library that executes the request (axios/axios#3369). However, I found a workaround. I will inform you once it is done. |
Hey @d-sooter, this issue has been fixed with version 1.31.0. Let us know if you still encounter any issues. |
Thank you very much ill try it out. Kind regards |
We are facing issues using the cloud sdk to access an on premise system through the cloud connector.
The first request (to fetch the x-csrf-token) returns without a body and causes an error and the actual post never happens.
If I fetch the token myself I am able to pass it in the batch as a header.
The get request needs to be able to handle an empty body.
an easy way to reproduce it is to use
executeHttpRequest() and only pass the odata service (without an entity in the url)
a simple get request should fail.
kind regards
David
The text was updated successfully, but these errors were encountered: