OpenMediaVault-Plugin-Developers / openmediavault-compose

openmediavault plugin for docker-compose
18 stars 6 forks source link

500 - internal Server Error when trying to deploy container #7

Closed CoderTobi closed 1 year ago

CoderTobi commented 1 year ago

Hello, it seams like the plugin is for some reason adding another slash that shouldn't be there. Here is the full error message:

Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; docker-compose --file '/compose//Portainer CE/Portainer CE.yml' --env-file '/compose//Portainer CE/Portainer CE.env' config 2>&1': validating /compose/Portainer CE/Portainer CE.yml: services.portainer Additional property environemt is not allowed

`OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; docker-compose --file '/compose//Portainer CE/Portainer CE.yml' --env-file '/compose//Portainer CE/Portainer CE.env' config 2>&1': validating /compose/Portainer CE/Portainer CE.yml: services.portainer Additional property environemt is not allowed in /usr/share/openmediavault/engined/rpc/compose.inc:486 Stack trace:

0 /usr/share/php/openmediavault/rpc/serviceabstract.inc(619): OMVRpcServiceCompose->{closure}('/tmp/bgstatusdT...', '/tmp/bgoutputyb...')

1 /usr/share/openmediavault/engined/rpc/compose.inc(489): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))

2 [internal function]: OMVRpcServiceCompose->doCommand(Array, Array)

3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

4 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('doCommand', Array, Array)

5 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Compose', 'doCommand', Array, Array, 1)

6 {main} `

Instead of '/compose//Portainer CE/Portainer CE.yml' it should be '/compose/Portainer CE/Portainer CE.yml'

image

CoderTobi commented 1 year ago

Ok, after a lot of tinkering I got it to work. I had to use the environment file. If I put my environment variables in the compose file, it would result in an error message. Still, it might make sense to communicate this more clearly. Also, I don’t see a way to remove a network from the plugin.

wvoigt commented 1 year ago

I am hitting this bug too. As a new OpenMediaVault user, this has been very frustrating. It basically has prevented me from getting any docker containers going.

ryecoaaron commented 1 year ago

Sorry but this isn’t a bug. The error in the screenshot is reporting an error in the compose file. The plugin reports the error docker-compose is reporting. Not sure how it would tell you more.

A compose file can use an existing network. So the network shouldn’t have to be removed.

estragonator commented 1 year ago

Sorry but this isn’t a bug. The error in the screenshot is reporting an error in the compose file. The plugin reports the error docker-compose is reporting. Not sure how it would tell you more.

A compose file can use an existing network. So the network shouldn’t have to be removed.

I agree this looks like a spelling mistake in the compose file: "property environemt is not allowed" I do want to add that I ran into a similar issue last weekend where I made a mistake in my property file and the error message confused me for a while. Maybe the output could be more user friendly to differenciate between "plugin" errors and validation errors from docker-compose?

CoderTobi commented 1 year ago

#

Maybe the output could be more user friendly to differentiate between "plugin" errors and validation errors from docker-compose?

That is what I mean. I had a lot of trouble getting the plugin and docker working in the first place and a lot of "connection lost" and "500 - internal Server Error". So it really took me a while to figure out that the dockerfile was wrong. If I click on validate, I expect something like "Success, no errors found" or "Nope, there is an error in your file" and not really a internal Server error when validating even though the server error contained the Docker error.

ryecoaaron commented 1 year ago

That is what I mean. I had a lot of trouble getting the plugin and docker working in the first place and a lot of "connection lost" and "500 - internal Server Error". So it really took me a while to figure out that the dockerfile was wrong. If I click on validate, I expect something like "Success, no errors found" or "Nope, there is an error in your file" and not really a internal Server error when validating even though the server error contained the Docker error.

Connection lost is not something you should see very often. Only when installing a plugin. As for the "500 - internal server error", if you read the end of the message, it is the error message from docker-compose. The plugin is using the omv error framework. Hard to avoid since the backend has to do the checking. So, while it may server error, it is not. I can only do what the framework supports. You are always free to keep using portainer if you need more of these compose file development features. Anything developed on portainer could be cut and paste into the plugin.