optimajet/WorkflowServer

Docker compose not working

Closed this issue · 3 comments

Hello,

After look at integrating Engine into a desktop app, I wanted to try the server edition afterall. To be quick and easy, I wanted to use the docker compose script provided but they don't work out of the box. Seems like either (or both) vanilla config of a Windows installation of Docker doesn't work and some files are missing or misplaced.

I'm not really use to config file for docker-composer, but since the log seems to talk about filesharing, I looked a bit into that. Right off the hook, it seems that the dbdata folder for the db services doesn't exist. Same goes for the dockerfile itself in workflowserver service, it is not in the folder stated in the config ./WorkflowServer/Dockerfile (so, since it's a dot, it should be found in docker-compose/postgresql/WorkflowServer, yet it is nowhere to be found, even elsewhere in the repository. Again, the log folder, same thing, doesn't exist to start with. So I don't know which one is causing the issues, but clearly the non-existing dockerfile is a probable cause to start with.

I've tried the export COMPOSE_CONVERT_WINDOWS_PATHS=1, didn't change the result below.

Anything else to look after?

Full log when launching the composer-start.bat script:

PS D:\HIDDEN\workflowEngine\WorkflowServer\docker-compose\postgresql> .\compose-start.bat

D:\HIDDEN\workflowEngine\WorkflowServer\docker-compose\postgresql>docker-compose run --rm start_db
Starting postgresql_db_1 ... done
ERROR: Cannot create container for service start_db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled","StackTrace":"   at Docker.ApiServices.Mounting.FileSharing.<DoShareAsync>d__6.MoveNext() in C:\\workspaces\\stable-2.3.x\\src\\github.com\\docker\\pinata\\win\\src\\Docker.ApiServices\\Mounting\\FileSharing.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.Mounting.FileSharing.<ShareAsync>d__4.MoveNext() in C:\\workspaces\\stable-2.3.x\\src\\github.com\\docker\\pinata\\win\\src\\Docker.ApiServices\\Mounting\\FileSharing.cs:line 47
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.HttpApi.Controllers.FilesharingController.<ShareDirectory>d__2.MoveNext() in C:\\workspaces\\stable-2.3.x\\src\\github.com\\docker\\pinata\\win\\src\\Docker.HttpApi\\Controllers\\FilesharingController.cs:line 21
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"}

D:\HIDDEN\workflowEngine\WorkflowServer\docker-compose\postgresql>docker-compose up workflowserver
Building workflowserver
ERROR: Cannot locate specified Dockerfile: ./WorkflowServer/Dockerfile

One step further, I replaced the build: context: ../.. dockerfile: ./WorkflowServer/Dockerfile section with image: optimajet/workflowserver. I also changed the settings in Docker about allowed sub folder to be mounted in Docker. And using the cmd instead of Powershell. I was able to go farther, but not yet launched.

It seems that the stard_db services is not able to read the shell script, and then workflow server can't start up. I got this error. Seems related to the database... Should I init the database first? Should a docker install take care of that?

D:\HIDDEN\workflowEngine\WorkflowServer\docker-compose\postgresql>docker-compose run --rm start_db
Creating network "postgresql_default" with the default driver
Creating postgresql_db_1 ... done
'bin/sh: can't open '

D:\HIDDEN\workflowEngine\WorkflowServer\docker-compose\postgresql>docker-compose up workflowserver
postgresql_db_1 is up-to-date
Creating postgresql_workflowserver_1 ... done
Attaching to postgresql_workflowserver_1
workflowserver_1  | WorkflowServer by OptimaJet 2020
workflowserver_1  | WorkflowEngine: Init...
workflowserver_1  |
workflowserver_1  | Unhandled Exception: System.AggregateException: One or more errors occurred. (42P01: relation "public.WorkflowGlobalParameter" does not exist) ---> Npgsql.PostgresException: 42P01: relation "public.WorkflowGlobalParameter" does not exist
workflowserver_1  |    at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
workflowserver_1  | --- End of stack trace from previous location where exception was thrown ---
workflowserver_1  |    at Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
workflowserver_1  | --- End of stack trace from previous location where exception was thrown ---
workflowserver_1  |    at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming)
workflowserver_1  |    at Npgsql.NpgsqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
workflowserver_1  |    at OptimaJet.Workflow.PostgreSQL.DbObject`1.SelectAsync(NpgsqlConnection connection, String commandText, NpgsqlParameter[] parameters)
workflowserver_1  |    --- End of inner exception stack trace ---
workflowserver_1  |    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
workflowserver_1  |    at OptimaJet.Workflow.PostgreSQL.WorkflowGlobalParameter.SelectByTypeAndName(NpgsqlConnection connection, String type, String name)
workflowserver_1  |    at OptimaJet.Workflow.PostgreSQL.PostgreSQLProvider.LoadGlobalParameters[T](String type)
workflowserver_1  |    at OptimaJet.WorkflowServer.CallbackProvider.RefreshRuntimeParameters() in /src/OptimaJet.WorkflowServer/CallbackProvider.cs:line 83
workflowserver_1  |    at OptimaJet.WorkflowServer.WorkflowServerRuntime.CreateRuntimePostgreSQL() in /src/OptimaJet.WorkflowServer/WorkflowServerRuntime.cs:line 345
workflowserver_1  |    at OptimaJet.WorkflowServer.WorkflowServerRuntime.InitWorkflowEngine() in /src/OptimaJet.WorkflowServer/WorkflowServerRuntime.cs:line 144
workflowserver_1  |    at OptimaJet.WorkflowServer.WorkflowServerRuntime..ctor(ServerSettings serverSettings) in /src/OptimaJet.WorkflowServer/WorkflowServerRuntime.cs:line 125
workflowserver_1  |    at OptimaJet.WorkflowServer.Initializing.WorkflowServerInitializer.BuildWebHost(Action`1 registerOwnActionsAndRules) in /src/OptimaJet.WorkflowServer/WorkflowServerInitializer.cs:line 76
workflowserver_1  |    at WorkflowServer.Program.Main(String[] args) in /src/WorkflowServer/Program.cs:line 15
postgresql_workflowserver_1 exited with code 139

Picture1

So, I did have to run the initial SQL script for it to run.

As a suggestion, could it be possible for a docker install to be more friendly. Maybe letting know in the manual the file sharing potential issue on windows, and that SQL script must be run manually (or even better, make them work during the first launch!)

Hi, thank you for the report. We have fixed it. New instructions https://workflowengine.io/documentation/workflow-server/how-to-launch/#docker