Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.84k stars 1.58k forks source link

docker compose up 1 error(s) decoding: * error decoding 'command': invalid command line string #12667

Closed leolivier closed 11 months ago

leolivier commented 11 months ago

Checklist

Hosting

Describe the bug When running the command:

docker compose up

I get

1 error(s) decoding:

* error decoding 'command': invalid command line string

After investigation, the issue is on the docker-compose.yaml command line where

    command: redis-server --requirepass ${REDIS_PASSWORD}

should be replaced by

    command: redis-server --requirepass "${REDIS_PASSWORD}"

because the redis password can contain special characters

To Reproduce Steps to reproduce the behavior:

  1. Download the docker-compose.yaml file from https://raw.githubusercontent.com/Budibase/budibase/master/hosting/docker-compose.yaml
  2. Download the .env file from https://raw.githubusercontent.com/Budibase/budibase/master/hosting/.env
  3. Update the .env file with password, including special characters like ^ or [ or ( in the redis password (REDIS_PASSWORD)
  4. Run docker compose up
  5. See error

Expected behavior No error

Desktop (please complete the following information):

linear[bot] commented 11 months ago

BUDI-7859 docker compose up 1 error(s) decoding: * error decoding 'command': invalid command line string

leolivier commented 11 months ago

Other issues I found when trying to run budibase on my Raspberry PI:

leolivier commented 11 months ago

Sorry @melohagan this is wrong. docker compose is the right command now since more than one year as it has been natively integrated inside docker. See for instance https://docs.docker.com/compose/features-uses/

melohagan commented 11 months ago

Sorry @melohagan this is wrong. docker compose is the right command now since more than one year as it has been natively integrated inside docker. See for instance https://docs.docker.com/compose/features-uses/

Yep thanks! I understand the issue now, sorry about that 👍

leolivier commented 11 months ago

Thanks @melohagan Did you also take into account the 2 other sub issues mentioned in the second comment ?

  1. set OFFLINE_MODE=yes in .env (otherwise error when starting)
  2. The second one is more in the documentation: it's wrong to say that you must set couchbase platform to linux/amd64 on ARM platforms (maybe, it's needed from AMD platforms but I don't think so as couchbase provides a multiplatform image and the right platform is selected automatically by docker at pull time)
melohagan commented 11 months ago

Hey @leolivier

The second one is more in the documentation: it's wrong to say that you must set couchbase platform to linux/amd64 on ARM platforms (maybe, it's needed from AMD platforms but I don't think so as couchbase provides a multiplatform image and the right platform is selected automatically by docker at pull time)

I think the docs are correct because the platform indicates that a linux/amd64 emulation should be run.

The OFFLINE_MODE causing errors on start up seems to be a separate bug. As far as I could see, you should be able to omit this variable and not have to set it to 'yes'/1.

@mike12345567 Would you be able to confirm these points?

leolivier commented 11 months ago

No, the doc is wrong, it says if you have an ARM platform, you must put linux/amd64 Look at https://docs.budibase.com/docs/docker-compose (and also in the docker compose video)

If you have an ARM-based CPU, you will have to update your docker-compose.yaml. Update the couchdb-service part of your compose config with:

couchdb-service:
    platform: linux/amd64
    ...
mike12345567 commented 11 months ago

@melohagan The docs will need updated - as of the recent update to use our ARM compatible image budibase/couchdb it is no longer required to set the AMD64 emulation mode as there is a native image that can be used.

As for the OFFLINE_MODE - it should not need to be set for the system to startup unless you are in an offline environment.

EDIT: I have updated the docs to remove the statement on ARM compat.

leolivier commented 11 months ago

thanks @mike12345567 Not only that setting AMD emulation is not needed but the image won't start with a "wrong architecture" error. Concerning OFFLINE_MODE, I had an error at startup and I'm not the only one, there is a discussion on github about that, see https://github.com/Budibase/budibase/discussions/12241. I'm running on a basic RPi, so not offline or whatever, but it won't start if OFFLINE_MODE is not set to something (I just tried yes but maybe no would also have solved the issue, I think it's more a syntax error when the string is empty)

mike12345567 commented 11 months ago

Hi @leolivier - I have just attempted to startup the docker compose stack on my RPi (5) with the latest docker/docker compose version and did not run into any trouble leaving the OFFLINE_MODE unset other than a warning message, but it shouldn't cause any problems.

I've gotten rid of the warning message as it was meaningless in this PR: https://github.com/Budibase/budibase/pull/12712 - if you update your docker-compose.yml once this is merged you shouldn't see the warning message either.

leolivier commented 11 months ago

Hi @mike12345567 I confirm: I added the change in my docker-compose.yaml file (replacing twice OFFLINE_MODE: {OFFLINE_MODE} by OFFLINE_MODE: {OFFLINE_MODE:-} and restarted the services with docker compose up -dand it worked w/o any warning