OPCFoundation / UA-CloudLibrary

OPC UA Information Model database with a REST and GraphQL interface, as well as user management. The global instance of this (hosted by the OPC Foundation) can be found at https://uacloudlibrary.opcfoundation.org.
Other
37 stars 18 forks source link

Bug with default docker-compose.yml seems to persist #122

Closed marchandpatrick closed 1 year ago

marchandpatrick commented 2 years ago

Bug with default docker-compose.yml seems to persist:

I am trying to use default startup script for a local cloudlibrary.

I first add to change default mail address to a valid looking mail address PGADMIN_DEFAULT_EMAIL: uacloudlib@gmail.com

Then run PS C:\Users\marchand\source\repos\UA-Cloudlibrary> docker compose up [+] Running 3/3

This seems to be the pb identified in 90 comment: https://github.com/OPCFoundation/UA-CloudLibrary/issues/90#issuecomment-1129069869

barnstee commented 2 years ago

Appears to be an old build, as this was definately fixed. Can you try out the latest container and delete the old one if you still have it in your docker image list.

BoBiene commented 2 years ago

to use the compose up command without Visual Studio there needs to be some additional setup.

Currently we only support the docker-compose from inside the Visual Studio - it is based on the logic, that the VS is building a new version of the container.

marchandpatrick commented 2 years ago

More tests:

1- Reload 2022 07 18 git repo

image

2- Remove all containers

PS C:\Users\marchand\source\repos\UA-Cloudlibrary> docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES => No more containers

3- With vs code, launch docker-compose up

PS C:\Users\marchand\source\repos\UA-Cloudlibrary> docker-compose up Creating network "ua-cloudlibrary_default" with the default driver Creating ua-cloudlibrary_pgadmin_1 ... done Creating ua-cloudlibrary_db_1 ... done Creating ua-cloudlibrary_ua-cloudlibrary_1 ... done Attaching to ua-cloudlibrary_pgadmin_1, ua-cloudlibrary_db_1, ua-cloudlibrary_ua-cloudlibrary_1 db_1 | The files belonging to this database system will be owned by user "postgres". db_1 | This user must also own the server process. db_1 | db_1 | The database cluster will be initialized with locale "en_US.utf8". db_1 | The default database encoding has accordingly been set to "UTF8". db_1 | The default text search configuration will be set to "english". db_1 | db_1 | Data page checksums are disabled. db_1 | db_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok db_1 | creating subdirectories ... ok db_1 | selecting dynamic shared memory implementation ... posix db_1 | selecting default max_connections ... 100 db_1 | selecting default shared_buffers ... 128MB db_1 | selecting default time zone ... Etc/UTC db_1 | creating configuration files ... ok db_1 | running bootstrap script ... ok

pgadmin_1 | 'uacloudlib' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again.

ua-cloudlibrary_1 | Unhandled exception. System.Exception: Invalid HostingPlatform specified in environment! Valid variables are Azure, AWS and GCP

ua-cloudlibrary_1 | at UACloudLibrary.Startup.ConfigureServices(IServiceCollection services) in /src/UACloudLibraryServer/Startup.cs:line 159 ua-cloudlibrary_1 | at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) ua-cloudlibrary_1 | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ua-cloudlibrary_1 | at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services) ua-cloudlibrary_1 | at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>cDisplayClass9_0.gStartup|0(IServiceCollection serviceCollection) ua-cloudlibrary_1 | at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services) ua-cloudlibrary_1 | at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>cDisplayClass8_0.b0(IServiceCollection services) ua-cloudlibrary_1 | at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance) ua-cloudlibrary_1 | at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.b__0(HostBuilderContext context, IServiceCollection services) ua-cloudlibrary_1 | at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider() ua-cloudlibrary_1 | at Microsoft.Extensions.Hosting.HostBuilder.Build() ua-cloudlibrary_1 | at UACloudLibrary.Program.Main(String[] args) in /src/UACloudLibraryServer/Program.cs:line 39 db_1 | performing post-bootstrap initialization ... ok ua-cloudlibrary_ua-cloudlibrary_1 exited with code 139 db_1 | syncing data to disk ... ok db_1 | db_1 | db_1 | Success. You can now start the database server using: db_1 | db_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start db_1 | db_1 | initdb: warning: enabling "trust" authentication for local connections
db_1 | You can change this by editing pg_hba.conf or using the option -A, or
db_1 | --auth-local and --auth-host, the next time you run initdb. db_1 | waiting for server to start....2022-07-18 14:02:42.500 UTC [50] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit db_1 | 2022-07-18 14:02:42.522 UTC [50] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2022-07-18 14:02:42.566 UTC [51] LOG: database system was shut down at 2022-07-18 14:02:34 UTC db_1 | 2022-07-18 14:02:42.583 UTC [50] LOG: database system is ready to accept connections db_1 | done db_1 | server started ua-cloudlibrary_pgadmin_1 exited with code 0 db_1 | CREATE DATABASE db_1 | db_1 | db_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/* db_1 | db_1 | waiting for server to shut down....2022-07-18 14:02:43.709 UTC [50] LOG: received fast shutdown request db_1 | 2022-07-18 14:02:43.717 UTC [50] LOG: aborting any active transactions
db_1 | 2022-07-18 14:02:43.721 UTC [50] LOG: background worker "logical replication launcher" (PID 57) exited with exit code 1 db_1 | 2022-07-18 14:02:43.722 UTC [52] LOG: shutting down db_1 | 2022-07-18 14:02:43.772 UTC [50] LOG: database system is shut down db_1 | done db_1 | server stopped db_1 | db_1 | PostgreSQL init process complete; ready for start up. db_1 | db_1 | 2022-07-18 14:02:43.886 UTC [1] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
db_1 | 2022-07-18 14:02:43.889 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1 | 2022-07-18 14:02:43.889 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1 | 2022-07-18 14:02:43.923 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2022-07-18 14:02:43.949 UTC [64] LOG: database system was shut down at 2022-07-18 14:02:43 UTC db_1 | 2022-07-18 14:02:43.967 UTC [1] LOG: database system is ready to accept connections pgadmin_1 | 'uacloudlib' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again. pgadmin_1 | 'uacloudlib' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again. pgadmin_1 | 'uacloudlib' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again. pgadmin_1 | 'uacloudlib' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again. … => Errors concerning email address and non specified HostingPlatform variable

4- New run with corrected email address:

image

PS C:\Users\marchand\source\repos\UA-Cloudlibrary> docker-compose up Starting ua-cloudlibrary_db_1 ... done Recreating ua-cloudlibrary_pgadmin_1 ... done Starting ua-cloudlibrary_ua-cloudlibrary_1 ... done Attaching to ua-cloudlibrary_db_1, ua-cloudlibrary_ua-cloudlibrary_1, ua-cloudlibrary_pgadmin_1 db_1 | db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db_1 | db_1 | 2022-07-18 14:05:12.682 UTC [1] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit db_1 | 2022-07-18 14:05:12.729 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1 | 2022-07-18 14:05:12.729 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1 | 2022-07-18 14:05:12.753 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2022-07-18 14:05:12.784 UTC [27] LOG: database system was shut down at 2022-07-18 14:04:55 UTC db_1 | 2022-07-18 14:05:12.814 UTC [1] LOG: database system is ready to accept connections

ua-cloudlibrary_1 | Unhandled exception. System.Exception: Invalid HostingPlatform specified in environment! Valid variables are Azure, AWS and GCP

ua-cloudlibrary_1 | at UACloudLibrary.Startup.ConfigureServices(IServiceCollection services) in /src/UACloudLibraryServer/Startup.cs:line 159

… => 2nd error persists.

Should I specify HostingPlatform in docker-compose, and if so with which value for locally hosted application?

barnstee commented 1 year ago

It appears as if the UACloudLib container you use is not current, because if the hosting platform is not specified in the latest codebase, you should see this warning instead: WARNING: Using local filesystem for storage as HostingPlatform environment variable not specified or invalid!

Can you try to build the container first and then run docker compose?

marchandpatrick commented 1 year ago

Thank you for the hint.

Rebuilding container, I have been able to connect to UaCloudLib: image

image

Now I try to load a local information model, with UANodesetWebViewer launched locally.

First an official UA model:

image

Seems to have been loaded, no complains when validated. Try to access this loaded model: On first screen, access to local cloud library fails:

image

image => Failure to login. (tested several times)

Try to access with swager: Authorize done without complain, then execute infoModel

image

image

=> Error.

Either a bug or miss usage, please provide some guidance.

barnstee commented 1 year ago

We've fixed a similar issue recently. Can you try with the latest Docker containers again, please? If the problem persists, please send error logs.

barnstee commented 1 year ago

Closing due to inactivity.