-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
ABP Application Working on local but not working on IIS #17339
Comments
Screenshot attached: https://drive.google.com/drive/folders/1HLLm8Piyl9jM7sUguvi6YGyP1UY43CA5?usp=sharing |
If there is an error you can check the |
If possible shall we get on a call. |
Shall I use the self sign certificate. As the domain purchasing will happen once the portal will start working on iis. |
Yes, you can use self signed certificate. |
@maliming getting following error on log.txt while hosting on IIS log.txt output: System.InvalidOperationException: An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure' to the 'UseSqlServer' call. |
check the database to see if it exists. |
Database exists as it is working when running it from visual studio. This is happening when running the application from iis by putting the published folder in a folder. |
You can use sql server sa and password in your connection string. |
connectiong string used on IIS : attaching the log.txt here: |
Please remove |
updated connection string removed please find the updated log.txt |
hi @cgdif
This is an code problem. You can check the errors in the logs.txt. |
I checked the logs and tried multiple solutions, but the application is not working on IIS at all, last connection string I tried was. |
The same setup is working on IIS Express |
How can I reproduce this? Can you try without localdb? |
The steps I followed were: Published to a local folder. Create a site and app pool on IIS Keep the published folder as IIS Physical path. Other settings are Local System, No managed code. Then added 44352 with all unassigned ips in the managed binding. Added connection string in IIS Start the application and browse. |
The connection string should be exiting in the |
Yes, keeping the connection string in sync in all the places including the appsettings.json file. |
You can also run the app in the publish folder by If this work that's mean there is a problem with IIS. and I have no idea about IIS. |
I clicked the .exe on the published folder then the application was running. Although it was running on localhost with port 5000 is there a way to run it on System IP from the published folder without IIS. |
The problem is when I run the application on IP from the launch settings on visual studio and run the angular UI from IIS the UI is not able the access the API. |
Thanks for sharing the urls, let me try this. |
HI @maliming, I'm running the UI (Angular) from IIS and API using dotnet run --urls "http://192.168.29.86:44352" this command but the UI is not able to access the API. |
Your SSL certificate is invalid. |
okay, this same setup works when I run using ng serve --host="IP", please share the url if you have access to bind the self-sign certificate. I generated a self-sign certificate, but it is not showing up while running even when I've imported it and installed it. (Using mmc and IIS) |
This is nothing to do with abp. You can get an SSL certificate and set it correctly. Or you can use localhost and port as your domain names. |
UI started working on IIS by changing the hostname to localhost. I need to get a ssl for other domains. Thanks @maliming. |
Application keep on loading even after removing the ssl. When running on LAN and accessing over network. |
hi @Keertesh Check your application logs. |
2023-08-22 13:15:44.004 +05:30 [ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Abp.OpenIddict.EntityFrameworkCore.OpenIddictDbContext'. |
The full logs. |
|
It seems your migrations file is not up to date. Please check it. |
logs are further down I updated the migration, but the issue persists. getting token has expired, error validating the token in the Ui console. -- also please suggest on changing the default UI url from http://10.132.29.185 to http://10.132.29.185/abc |
You can also check the logs from your SQL server. |
@maliming When I'm login then I'm getting angular-oauth2-oidc.mjs token has expired, it is working fine on the system it is hosted. But when I'm accessing it on a system connected via LAN it is throwing the above error and the screen is stuck on Login and keep on calling the below API. Please suggest as the rest of the parts are working fine on the system it is hosted. I saw this in the logs: Please suggest. Error log |
getting this on IIS, Consider enabling transient error resiliency by adding 'EnableRetryOnFailure' to the 'UseSqlServer' call |
An exception occurred while iterating over the results of a query for context type 'Volo.Abp.BackgroundJobs.EntityFrameworkCore.BackgroundJobsDbContext' |
---> Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.) |
Documentation
Please check the official documentation before asking questions: https://docs.abp.io
GitHub Issues
GitHub issues are for bug reports, feature requests, and other discussions about the framework.
If you're creating a bug/problem report, please include the followings:
Please Application is working fine on localhost, but the APIs are not working when hosted on IIS.
appsettings.json
{ "App": { "SelfUrl": "https://192.168.0.187:44352", "ClientUrl": "http://192.168.0.187:4200", "CorsOrigins": "http://192.168.0.187:4200,https://192.168.0.187,https://192.168.0.187:*,https://*.dbt.com,http://localhost:4435,http://localhost:85,http://localhost:4200,127.0.0.1:80,https://localhost:44352,http://localhost:50278/,http://localhost:80,https://localhost:80", "RedirectAllowedUrls": "https://192.168.0.187:44352,http://192.168.0.187:4200,http://192.168.0.187:*/*,http://192.168.0.187:*/*,http://localhost:4200,https://localhost:44389,https://localhost:44352" }, "ConnectionStrings": { // "Default": "Server=tcp:dbcgdbt.database.windows.net,1433;Initial Catalog=cgdbt-db;Persist Security Info=False;User ID=difadmin;Password=Chhattisgarh.dif@123;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" "Default": "Server=(localdb)\\MSSQLLocalDB;Database=cgdbt;Trusted_Connection=True;MultipleActiveResultSets=true" }, "AuthServer": { "Authority": "https://192.168.0.187:44352", "RequireHttpsMetadata": "false", "SwaggerClientId": "dbt_Swagger" }, "StringEncryption": { "DefaultPassPhrase": "########" }, "Settings": { "IsSelfRegistrationEnabled": false, "Abp.Account.IsSelfRegistrationEnabled": false } }
DBMigrator>appsettings.json
{ "ConnectionStrings": { // "Default": "Server=tcp:dbcgdbt.database.windows.net,1433;Initial Catalog=cgdbt-db;Persist Security Info=False;User ID=difadmin;Password=Chhattisgarh.dif@123;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" "Default": "Server=(localdb)\\MSSQLLocalDB;Database=cgdbt;Trusted_Connection=True;MultipleActiveResultSets=true" }, "OpenIddict": { "Applications": { "dbt_Web": { "ClientId": "dbt_Web", "ClientSecret": "1q2w3e*", "RootUrl": "https://192.168.0.187:44325" }, "dbt_App": { "ClientId": "dbt_App", "RootUrl": "http://192.168.0.187:4200" }, "dbt_BlazorServerTiered": { "ClientId": "dbt_BlazorServerTiered", "ClientSecret": "1q2w3e*", "RootUrl": "https://192.168.0.187:44318" }, "dbt_Swagger": { "ClientId": "dbt_Swagger", "RootUrl": "https://192.168.0.187:44352/" } } } }
Launch settings:
{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "https://localhost:44352", "sslPort": 44352 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "chhattisgarh.dbt.HttpApi.Host": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://0.0.0.0:44352", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } }
updated entries in local DB under OpenIddictApplications table.
Stack Overflow
Please use Stack Overflow for your questions about using the framework, templates, and samples:
https://stackoverflow.com/questions/tagged/abp
Use abp tag in your questions.
The text was updated successfully, but these errors were encountered: