Starts in:
2 DAYS
11 HRS
24 MIN
16 SEC
Starts in:
2 D
11 H
24 M
16 S
Open Closed

License check failed for 'Volo.Abp.LanguageManagement.Domain.Shared-v2.3.0.0'. #69


User avatar
0
terrycullen created

Hi,

I'm trying to deploy the first instance of our application to our development server using docker containers. It's based on the project created from an untiered MVC pro template.. I have moved it to using Postgres instead of SQL Server and it works fine on my dev laptop (Mac).

I'm logged into a shell on a linux VM with not much more installed but docker/docker-compose.

I've previously built the docker containers (app & migrator) and have deployed the built containers to AWS ECR.

I run the below docker command to run the migrations -

docker run \
    --rm -i --network=web-network \
    -v "$(pwd)/migratorsettings.json:/app/appsettings.json" \
    -v "$(pwd)/data/log:/app/Logs" \
    -e "ASPNETCORE_ENVIRONMENT=Development" \
    <our aws acc id>.dkr.ecr.ap-southeast-2.amazonaws.com/web/migrator:Development-0000000006

Which produces the following error:

[03:05:38 ERR] ABP-LIC-0008 - License check failed for 'Volo.Abp.LanguageManagement.Domain.Shared-v2.3.0.0'.
You need to log in using the command `abp login &lt;username&gt;`.
For more information, contact to license@abp.io.

My assumption is that if I've provided an appsetting.json file that contains the AbpLicenceCode to the web server I've deployed this to, it should not need to login to ABP. I've included the file below and redected the secrets:

{
  "ConnectionStrings": {
    "Default": "Host=<redacted>;Database=<redacted>;Username=<redacted>;Password=<redacted>;Port=5432;Pooling=true;"
  },
  "IdentityServer": {
    "Clients": {
      "Web_Web": {
        "ClientId": "Web_Web",
        "RootUrl": "https://<redacted>.com.au/"
      },
      "Web_App": {
        "ClientId": "Web_App"
      }
    }
  },
  "AbpLicenseCode": "<redacted>"
}

I know that the docker container can find my appsettings.json because if I make the json invalid the migrator errors out saying that the JSON is invalid.

So, my question is - Is having the AbpLicenceCode parameter set in the appsetting file enough to get licencing working? If so, what might be wrong with this?

Terry


10 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    Issue:

    ABP makes an online license check only in Development environment or when the Debugger is Attached in Visual Studio. When it's in Development environment or Debugger is attached, it's required to login your account via ABP CLI ( abp login {username} )

    Solutions:

    1.Solution: When you run your app in a Docker container, set your environment as Production to skip online license check (or anything else other than Development). -e "ASPNETCORE_ENVIRONMENT=Production"

    2.Solution: If you are required to run the project in Development environment in the container, copy your local ABP token file %UserProfile%\.abp\cli\access-token.bin into the Docker container's relavant directory.

  • User Avatar
    0
    terrycullen created

    Thanks! Solution 1 worked.

  • User Avatar
    0
    edelivery created

    Hi alper! 2.Solution: If you are required to run the project in Development environment in the container, copy your local ABP token file %UserProfile%.abp\cli\access-token.bin into the Docker container's relavant directory.

    where Docker container's relavant directory I will copy? thanks

  • User Avatar
    0
    alper created
    Support Team Director

    by relavant directory, I mean the current user's home directory.

    For Windows it's => %UserProfile%\.abp\cli\

    For Linux it must be $HOME => /home/user/.abp/cli/

    See Windows and Linux variable equivalents from https://blog.softhints.com/windows-and-linux-variable-equivalents/ and https://blog.softhints.com/windows-cmd-vs-linux-shell-commands/

  • User Avatar
    0
    jhan created

    Hi alper Can you give me more detail answer for solution 2? I tried to copy the licnese file all of the "Docker container's relavant directory". but I cannot make it work.

    Windows user using linux conatiner.

  • User Avatar
    0
    alper created
    Support Team Director

    @jhan you should also be logging in via ABP CLI in the docker container. If the second solution doesn't work for you try to add this to your docker yaml.

    abp login <username> -p <password>
    
  • User Avatar
    0
    jhan created

    I'm new to Docker, so I wonder if I put the command right place.

    I added below command in each service that I'd like to run in docker-compose.yml

    command: abp login <myID> -p <password>

    it fails at build time.

    So I tired another one right after dotnet restore in each dockerfiles RUN abp login <myID> -p <password>

    but it still gives me the error that I need to login.

    Do I have to do something to use "abp" command in docker container?

    If you have a sample that I can run by replacing use id and password, it would be nice.

    I'm currently working on v.4.12 Module template

  • User Avatar
    -1
    alper created
    Support Team Director

    @jhan I forgot to tell you that you first need to install the ABP CLI.

    Run this first to install it

    dotnet tool install --global Volo.Abp.Cli
    

    On the other hand, copying the license file and session file is easier. Copy these 2 files from your computer to your Docker container:

    %UserProfile%\.\AppData\Local\Temp\AbpLicense.bin
    %UserProfile%\.abp\cli\access-token.bin
    
  • User Avatar
    0
    alper created
    Support Team Director

    you can create a new question because. this is a closed question and other subscribers of this question gets your notification

  • User Avatar
    0
    alper created
    Support Team Director

    extra information

    1- see this https://gist.github.com/ebicoglu/f7cd77069fa053cbe9cf9e9ffcc2f2d2 2- Don't use Alpine before v4.2.X . You can use mcr.microsoft.com/dotnet/sdk:5.0-focal or any other distro that has /bin/bash. ABP After ABP v4.2 you can use any Linux distro you want.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06