Azure File Storage the server responded with a status of 400 (Condition headers are not supported.) - azure-storage

I have some png files stored in Azure file Storage, and I'm retrieving and displaying it from my MVC web project to the browser. But sometimes I get the below error message from browser console.
Failed to load resource: the server responded with a status of 400
(Condition headers are not supported.)
If I refresh the page again, the error message disappears automatically. But it doesn't solve my problem as I run my MVC project again, the same error comes back. How to solve it?

It's acutally a common issue on Azure Storage, which be listed in the offical reference Common REST API Error Codes as the figure below.
It means that Get File REST API does not support those request headers which not be listed in the Request Headers.
There is a similar SO thread Azure File Storage Error: Condition Headers Are Not Supported, which got the same issue with yours. It seems to show up different behavior in different browses when you get a file from Azure File Storage.
I could not reproduce this issus by a file url with SAS token, but I really recommend that you need to store these static files like images on Azure Blob Storage, as I known and as Azure best practice, to show an image by its url with sas token or a public container.

Related

users api of geoserver

I was using geoserver api to create a new user for my application, after I upgraded my geoserver to 2.18.2 the same code doesn't work any more.
until now I used this route which was working absolutely fine:
http://geoserver:8080/geoserver/geofence/rest/usergroup/service/jdbc_userservice/users
If i still use this route, I get this error:
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Therefore I tried this route which I found in their api docs:
localhost:8080/geoserver/rest/security/usergroup/users
but I get this error:
Type Status Report
Message Forbidden
Description The server understood the request but refuses to authorize it.
any hint or docs about this issue will be appreciated.

How to upload pdf to S3 bucket?

I recorded jmeter script with blazemeter to upload a pdf file to the s3 bucket.When I parameterize the required values and execute the script to upload the file I am getting the error response
Response code: 403
Response message: Forbidden
All the parameters have correct values passed.
You should also get an appropriate Error Code which provides way more information regarding what's wrong, i.e. Access Denied or All access to this Amazon S3 resource has been disabled., once you know the root cause you should be able to figure out what needs to be done in order to resolve the issue.
Also double check all the request parameters using Debug Sampler and View Results Tree listener, for example you cannot record and replay X-Amz-Signature, you need to generate a proper one for each and every request, see How to Handle Dynamic AWS SigV4 in JMeter for API Testing article for more details

ASP.NET Core / HTTP Error 404.13 - Not Found

When i try to upload large files(>30Mb) to my server I get generic 404 error. But it does not allow me to render appropriate message("File too large") to make sure that user understands why upload fails.
So is there a way to catch this error before IIS returns a 404 response back to the user and return a different header with a custom error?
Because right not the only way for me to know that this error was due to a file size is thru analyzing server logs for the failed requests.
If not, is there a way to access the maxAllowedContentLength directive thru the controller to pass this value back to the ui so user can compare the content length before upload?

How to resolve 500 Message:An error has occurred while Accessing API from Azure?

I am working with Azure Mobile Services API, my API on the local host running well. I have checked with the help of Swagger UI. but when I publish my API to azure then after that by accessing the API with Swagger I got this error.
500 : {"Message":"An error has occurred."} http://xxxxxxxxxxx.azurewebsites.net/swagger/docs/v1
Now if I type this route http://xxxxxxxxxxx.azurewebsites.net/tables/doctor?ZUMO-API-VERSION=2.0.0
to any table then I got the result,
why not with swagger?
help me to get on the right path.
Please make sure your XML file is available on the same location as you have defined in the swagger UI properties on Azure.
I would highly recommend to generate your swagger xml file
Steps :
Right click on webapi project
Properties => build tab
Output section - in different folder other than bin.
For example : App_Start\\{ProjectName}.xml

OneDrive API: Getting Internal server Error while using action.createLink for a shared file

I am trying to create a publicly shared link for OneDrive files.
I have got onedrive.readwrite scope from the onedrive account(A).
I tried creating a sharing link for the Account A's file using the following call,
https://api.onedrive.com/v1.0/drive/items/{normal_file_id}/action.createLink
and it worked. I got the web url and the status is 200.
Then I shared another Account B's folder with Account A.
Now,
I tried the same by creating a sharing link for the Account A's shared file of Account B using the following call,
https://api.onedrive.com/v1.0/drive/items/{shared_file_id}/action.createLink
Now, I am getting internal server error with status 500.
I tried both these scenarios in Apigee console. getting the same trouble.
Interestingly when I look into the sharing info for the file in Onedrive. I can see a Sharing link created for that file in the name of Apigee Api console.
But, I am always getting 500 errors while working in API. How to rectify this problem?
It looks like this is a bug in the API. The error is happening after link creation but before the API call returns which is why the link is successfully created. Please use the issue you opened on GitHub to track: https://github.com/OneDrive/onedrive-api-docs/issues/237