Skip to content
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

docker compose installation. #3160

Open
alessiocamillohome opened this issue Mar 7, 2023 · 5 comments
Open

docker compose installation. #3160

alessiocamillohome opened this issue Mar 7, 2023 · 5 comments
Labels
Question Issue is a question? VSTS-Backlog On VSTS Backlog

Comments

@alessiocamillohome
Copy link

alessiocamillohome commented Mar 7, 2023

Hello everyone,
i am trying to install the fhir-api server and database using the docker-compose command and following the instructions report in the documentation (https://github.com/microsoft/fhir-server/tree/main/samples/docker):

Using docker-compose this image can be started with the following steps:
Open a terminal window.
Set the enviornment variable SAPASSWORD to what you want the SQL access password to be. Be sure to follow the [SQL server password complexity requirements](https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver15#password-complexity).
Copy & save a local version of the docker-compose file from the release directory of the fhir-server project.
Run the command:
docker-compose up -d .
After giving the container a minute to start up it should be accessable at http://localhost:8080/metadata.

Unfortunately in the Log I have the following error which I think does not start the fhir-api server correctly.

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
fhir-server-fhir-api-1  |    at System.Lazy`1.CreateValue()
fhir-server-fhir-api-1  |    at Hl7.FhirPath.FhirPathCompiler.get_DefaultSymbolTable()
fhir-server-fhir-api-1  |    at Microsoft.Health.Fhir.Api.Modules.FhirModule.Load(IServiceCollection services) in /repo/src/Microsoft.Health.Fhir.Shared.Api/Modules/FhirModule.cs:line 58
fhir-server-fhir-api-1  |    at Microsoft.Health.Extensions.DependencyInjection.ServiceCollectionExtensions.RegisterModule(IServiceCollection collection, Type moduleType, Object[] constructorParams)
fhir-server-fhir-api-1  |    at Microsoft.Health.Extensions.DependencyInjection.ServiceCollectionExtensions.RegisterAssemblyModules(IServiceCollection collection, Assembly assembly, Object[] constructorParams)
fhir-server-fhir-api-1  |    at Microsoft.Extensions.DependencyInjection.FhirServerServiceCollectionExtensions.AddFhirServer(IServiceCollection services, IConfiguration configurationRoot, Action`1 configureAction) in /repo/src/Microsoft.Health.Fhir.Shared.Api/Registration/FhirServerServiceCollectionExtensions.cs:line 88
fhir-server-fhir-api-1  |    at Microsoft.Health.Fhir.Web.Startup.ConfigureServices(IServiceCollection services) in /repo/src/Microsoft.Health.Fhir.Shared.Web/Startup.cs:line 45
fhir-server-fhir-api-1  |    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
fhir-server-fhir-api-1  |    at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
fhir-server-fhir-api-1  |    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.<ConfigureServices>g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.WebHost.EnsureApplicationServices()
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.WebHost.Initialize()
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
fhir-server-fhir-api-1  |    at Microsoft.Health.Fhir.Web.Program.Main(String[] args) in /repo/src/Microsoft.Health.Fhir.Shared.Web/Program.cs:line 20

The full docker-compose file:

version: "3"
services:
  fhir-api:
    image: "mcr.microsoft.com/healthcareapis/r4-fhir-server"
    restart: on-failure
    environment:
      FHIRServer__Security__Enabled: "false"
      SqlServer__ConnectionString: "Server=tcp:sql,1433;Initial Catalog=FHIR;Persist Security Info=False;User ID=sa;Password=<SAPASSWORD>;MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=true;"
      SqlServer__AllowDatabaseCreation: "true"
      SqlServer__Initialize: "true"
      SqlServer__SchemaOptions__AutomaticUpdatesEnabled: "true"
      DataStore: "SqlServer"
    ports:     
      - "8080:8080"
    depends_on:
      - sql
  sql:
    image: "mcr.microsoft.com/mssql/server"
    environment:
      SA_PASSWORD: <SAPASSWORD>
      ACCEPT_EULA: "Y"
    healthcheck:
        test: ["CMD", "/opt/mssql-tools/bin/sqlcmd","-U sa -P <SAPASSWORD> -Q 'SELECT * FROM INFORMATION_SCHEMA.TABLES'"]
        interval: 10s
        timeout: 10s
        retries: 6

My working environment is a Macbook M1 Pro with macOS Ventura 13.2.1.
The version of Docker is 20.10.23 (with Use Virtualization framework and Use Rosetta for x86/amd64 emulation on Apple Silicon checked)
Is this environment supported for this version of the fhir server?

Thanks for your support.

@alessiocamillohome alessiocamillohome added the Question Issue is a question? label Mar 7, 2023
@EXPEkesheth EXPEkesheth added the Review Tag for PM/Dev Review label Mar 7, 2023
@EXPEkesheth
Copy link
Collaborator

@alessiocamillohome , thanks for reporting the issue. We will investigate the issue.

@EXPEkesheth
Copy link
Collaborator

AB#101532

@EXPEkesheth EXPEkesheth added VSTS-Current We are working on this item in the current sprint and removed Review Tag for PM/Dev Review labels Mar 20, 2023
@abiisnn
Copy link
Contributor

abiisnn commented Apr 7, 2023

Would you mind sharing the command you used to see the logs?

@shabanlushaj
Copy link

It's not related at all but docker sample needs to be updated:
Connection string misses TrustServerCertificate=true property which causes System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback. (docker-compose file has it).

https://github.com/microsoft/fhir-server/tree/main/samples/docker#:~:text=%22%20%2De-,SqlServer__ConnectionString,-%3D%22Server

@ayoubbensakhria
Copy link

ayoubbensakhria commented Apr 24, 2023

Works fine for me Ubuntu 20.04: SAPASSWORD has to meet the SQL Server password policy requirements.

@EXPEkesheth EXPEkesheth added VSTS-Backlog On VSTS Backlog and removed VSTS-Current We are working on this item in the current sprint labels May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Issue is a question? VSTS-Backlog On VSTS Backlog
Projects
None yet
Development

No branches or pull requests

5 participants