We have big troubles with deploying our system. (Single Layser Application, MVC )
All is working fine at the development with Visual Studio. After deploying it to IIS all GET requests are working, but if we do an POST, PUT, DELETE we get an Error 400.
We are looking to fix the errors since days, we cannot find any solution in the forum.
Please help to fix the issue
-
Database System: EF Core (SQL Server)
-
Steps to reproduce the issue: After deploying to IIS no POST, PUT, DELETE is working. GET is working
13 Answer(s)
-
0
Hello,
Have you checked our document about deployment to ISS?
If not, you can access it here.You can also find tickets with the same problem as you below:
-
0
Hello,
Have you checked our document about deployment to ISS?
If not, you can access it here.You can also find tickets with the same problem as you below:
Yes, i have tried all this. can you help me over remote desktop?
-
0
Yes, i have tried all this. can you help me over remote desktop?
Unfortunately, we do not have such a service.
In the meantime, a colleague of our team said that this could also be caused by the hosting company. Some hosting companies do not open requests other than GET requests by default. Which hosting company do you use?
Note: Deployment is not a feature directly provided by ABP, but I still tried to help as much as we can.
-
0
Yes, i have tried all this. can you help me over remote desktop?
Unfortunately, we do not have such a service.
In the meantime, a colleague of our team said that this could also be caused by the hosting company. Some hosting companies do not open requests other than GET requests by default. Which hosting company do you use?
Note: Deployment is not a feature directly provided by ABP, but I still tried to help as much as we can.
The IIS is running on my local machine. The App is working if i will start it from Visual Studio, after deployment to IIS only the GET requests are working. The other one´s are not working.
-
0
Any chance you can send me the logs? Let's examine in detail.
-
0
Any chance you can send me the logs? Let's examine in detail.
e.g. Line 1699 i get this 400 error. The page is a normal from abp generated CRUD page.
-
0
By the way, have you tried disabling the WebDAV feature on Windows Server or Desktop machines?
https://dev.to/devvsamjuel/webdav-put-and-delete-http-verbs-remove-webdav-module-on-iis-3l1g
-
0
By the way, have you tried disabling the WebDAV feature on Windows Server or Desktop machines?
https://dev.to/devvsamjuel/webdav-put-and-delete-http-verbs-remove-webdav-module-on-iis-3l1g
Yes, i did
-
0
My teammate who is more experienced than me about ISS will try to help you.
-
0
It is a problem with the antiforgery token.
[17:08:47 INF] Notification is sent on same window time.
[17:08:54 INF] Request starting HTTP/1.1 POST http://localhost/InternationaleKennzeichen/CreateModal - application/x-www-form-urlencoded; charset=UTF-8 260
[17:08:54 INF] Executing endpoint '/InternationaleKennzeichen/CreateModal'
[17:08:54 INF] Route matched with {page = "/InternationaleKennzeichen/CreateModal", action = "", controller = "", area = ""}. Executing page /InternationaleKennzeichen/CreateModal
[17:08:54 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
[17:08:54 INF] Antiforgery token validation failed. The antiforgery token could not be decrypted.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
---> System.Security.Cryptography.CryptographicException: The key {9b83a679-a168-452b-8719-d75cefa55147} was not found in the key ring. For more information go to https://aka.ms/aspnet/dataprotectionwarning
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.DeserializeTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet, AntiforgeryToken& cookieToken, AntiforgeryToken& requestToken)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext)
at Microsoft.AspNetCo -
0
You can also find tickets with the same problem as you below:
https://abp.io/support/questions/7937/POST-PUT-and-DELETE-requests-return-a-Bad-Request-400-error
In a ticket I forwarded to you before, it was stated that the problem may be CRSF. However, since you said that you checked this and that this was not the problem, I did not think about it. But if this is the problem, could you try the following configuration and let me know if it works for you?
Configure<AbpAntiForgeryOptions>(options => { options.TokenCookie.SecurePolicy = CookieSecurePolicy.None; });
Because you are using HTTP, the XSRF-TOKEN cookie required HTTPS. If you want to use HTTP, you have to set
SecurePolicy
toCookieSecurePolicy.None
: -
0
I got the same error. For now i will disable it.
Configure<AbpAntiForgeryOptions>(options =>
{
options.AutoValidate = false;
});I know that is not the solution but i will enable it later.
I always got the exception "antiforgery the key was not found in the key ring". How can i handle the antiforgery key in abp?
-
0
hi
POST http://localhost/
As Berkansasmaz said, The problem is related to
HTTP.
You can use the solution from https://abp.io/community/articles/patch-for-chrome-login-issue-identityserver4-samesite-cookie-problem-weypwp3n