Ends in:
5 DAYS
6 HRS
37 MIN
34 SEC
Ends in:
5 D
6 H
37 M
34 S
Open Closed

Intialization error while running Authserver in docker desktop as docker image. #8124


User avatar
0
Anjaneyulu created

Check the samples to see the basic tasks: https://abp.io/docs/latest/samples The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info: 🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.

  • ABP Framework version: v8.3.1
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.AspNetCore.AbpAspNetCoreModule, Volo.Abp.AspNetCore, Version=8.3.1.0, Culture=neutral, PublicKeyToken=null: An exception was thrown while activating λ:Volo.Abp.AspNetCore.VirtualFileSystem.IWebContentFileProvider -> Volo.Abp.AspNetCore.VirtualFileSystem.WebContentFileProvider -> λ:Volo.Abp.VirtualFileSystem.IVirtualFileProvider -> Volo.Abp.VirtualFileSystem.VirtualFileProvider
  • Steps to reproduce the issue:
    1. Created new project using abp studio using multilayered template.
    1. Build and run the project Authserver project normally both in debug and relase mode.
    1. Setup docker environment with docker desktop, wsl2 , ubuntu 24lts
    1. Build docker image with the docker file created by the template.
    1. Run the docker image and im getting this error. I could run the authserver solution in debug and relase mode from my visual studio

Check the docs before asking a question: https://abp.io/docs/latest


9 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Please check similar issue https://abp.io/support/questions/5660/An-exception-was-thrown-while--2023-08-25-123409-activating-VoloAbpAspNetCoreVirtualFileSystemIWebContentFileProvider if it helps you.

    Thanks

  • User Avatar
    0
    Anjaneyulu created

    Hello this is my docker file


    FROM mcr.microsoft.com/dotnet/aspnet:8.0 COPY bin/Release/net8.0/publish/ app/ WORKDIR /app ENV ASPNETCORE_URLS=http://+:80 ENTRYPOINT ["dotnet", "XSenseID.AuthServer.dll"]


    This is the command i have used for build -> dotnet publish -c Release -o ./bin/Release/net8.0/publish

  • User Avatar
    0
    Anjaneyulu created

    Any update for this ?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    In Docker Run command, you has set ASPNETCORE_Environment to Development Can you try with Production ?

    Thanks,

  • User Avatar
    0
    Anjaneyulu created

    I tried but no luck.

    What i additional tried is to comment the virtual file explorer intialization code in the webodule and it moved forward where i had redis connection issue which i can understand.

  • User Avatar
    0
    Anjaneyulu created

    Does virtual file system doesnt work with docker ?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello Anjaneyulu,

    Please try to remove the ReplaceEmbeddedByPhysical code from the AuthServer.Module.cs file and check again.

    Thanks

  • User Avatar
    0
    Anjaneyulu created

    I have commented the VirtualFile explorer code .


    My docker compose file

    version: '3.7'

    volumes: xsenseid_rabbitmq: networks: xsenseid: external: true

    services: rabbitmq: container_name: rabbitmq image: rabbitmq:3.12.7-management-alpine volumes: - xsenseid_rabbitmq:/var/lib/rabbitmq networks: - xsenseid ports: - "15672:15672" - "5672:5672" redis: container_name: redis image: redis:7.2.2-alpine networks: - xsenseid ports: - "6379:6379" xsenseid-app: container_name: xsenseid-authserver image: xsenseid-authserver # Name of your built image depends_on: - rabbitmq - redis networks: - xsenseid environment: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://+:80 ports: - "8080:80" # Adjust port if necessary

    Redis and rabbitmq are running . Im able to connect to these instances from the host machine when i run the authserver from visual studio both in debug and release mode.

    But somehow when i run the authserver image in docker , im getting this log. Normally im not able to see logs or container is existing in few seconds.

    docker run -e DOTNET_CLI_TELEMETRY_OPTOUT=1 -e DOTNET_PRINT_TELEMETRY_MESSAGE=false -e ASPNETCORE_ENVIRONMENT=Development xsenseid-authserver -----> with this im able to see the exception

    If i do docker run -e DOTNET_CLI_TELEMETRY_OPTOUT=1 -e DOTNET_PRINT_TELEMETRY_MESSAGE=false -e ASPNETCORE_ENVIRONMENT=Production xsenseid-authserver ---------> I dont see any error or logs


    Exception: XSenseID.AuthServer terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.Identity.AbpIdentityProDomainModule, Volo.Abp.Identity.Pro.Domain, Version=8.3.1.0, Culture=neutral, PublicKeyToken=null: An exception was thrown while activating Volo.Abp.Identity.Session.IdentitySessionCleanupBackgroundWorker -> Volo.Abp.DistributedLocking.MedallionAbpDistributedLock -> λ:Medallion.Threading.IDistributedLockProvider.. See the inner exception for details. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.Identity.Session.IdentitySessionCleanupBackgroundWorker -> Volo.Abp.DistributedLocking.MedallionAbpDistributedLock -> λ:Medallion.Threading.IDistributedLockProvider. ---> StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). Error connecting right now. To allow this multiplexer to continue retrying until it's able to connect, use abortConnect=false in your connection string or AbortOnConnectFail=false; in your code.


    Thanks,

    If possible we can connect on teams call or anyother means to resolve this quickly. Appreciate your efforts and anticipating early resolution

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you use redis instead of 127.0.0.1 in appsettings.json in docker environment?

    "Redis": {
        "Configuration": "redis"
    },
    
Made with ❤️ on ABP v9.1.0-preview. Updated on November 26, 2024, 12:49