Issue Summary

My laptop is a new Apple Silicon M1 so I installed the preview version of Docker for Apple Silicon. When I git clone the Redash repo and then try to set it up using Docker via docker-compose up -d it runs into this error:

E: Unable to locate package msodbcsql17
ERROR: Service ‘server’ failed to build : The command ‘/bin/sh -c apt-get update && apt-get install -y curl gnupg build-essential pwgen libffi-dev sudo git-core wget libpq-dev g++ unixodbc-dev xmlsec1 libssl-dev default-libmysqlclient-dev freetds-dev libsasl2-dev unzip apt-transport-https ca-certificates libsasl2-modules-gssapi-mit && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 && apt-get clean && rm -rf /var/lib/apt/lists/*’ returned a non-zero code: 100

I’ve tried uninstalling/reinstalling/cleaning and what was suggested here: Unable to docker-compose build but did not work. Might have something to do with mysql limitations with Docker for M1: Apple M1 Tech Preview | Docker Documentation Can anyone think of any workarounds?

Technical details:

Are you using the M1 compatible docker installation? Or are you running the x86 version via translation? I also use an M1 laptop and have done both but it works better with Rosetta2 (translation) because the Apple Silicone compiled version is just unstable.

I am using the M1 Docker Preview. Do you have instructions on how I can run the x86 version via translation? When I try to download the non-M1 version it say there’s an incompatibility problem. Not sure what the next steps are exactly to set it up like you have. Thank you!!

You’re right. It shows me an error when I try now.

I can’t get Docker on M1 running at all without a bunch of kernel panics. Best to wait until it’s no longer in preview before attempting this again.

T I have the same problem. Have you solved it?

No, had to use my old laptop.

I finally got this working on my M1 Macbook Air. I’m using the Docker RC1 that was released on 18 Mar 2021. Version 3.3.0 (62029). And the latest tip of Redash master.

Background

At first I couldn’t start Docker at all. The application launched and then crashed my entire system. I followed these instructions to fix my bad installation. After a complete wipe of Docker, installing Big Sur updates, updating my xcode tools, and reinstalling the latest RC candidate my Docker opened normally :partying_face:

Changes

When I first ran docker-compose up -d I had the same error as OP:

E: Unable to locate package msodbcsql17
ERROR: Service ‘server’ failed to build : The command ‘/bin/sh -c apt-get update && apt-get install -y curl gnupg build-essential pwgen libffi-dev sudo git-core wget libpq-dev g++ unixodbc-dev xmlsec1 libssl-dev default-libmysqlclient-dev freetds-dev libsasl2-dev unzip apt-transport-https ca-certificates libsasl2-modules-gssapi-mit && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 && apt-get clean && rm -rf /var/lib/apt/lists/*’ returned a non-zero code: 100

However, since I’m not connecting to a Microsoft SQL Server right now I just modified the Dockerfile to skip this installation.

After this docker-compose up -d worked fine.

Then I installed NodeJS using an installer from their website and built the frontend assets:

npm install && npm run build

And created the database:

docker-compose run --rm server create_db

I added Redash’s own metadata DB as a data source and ran a quick query:

Performance is much slower than on my Intel Mac. But it’s suitable for basic development (especially front-end). The npm run build command is noticeably faster.

After commenting out the MYSQL ODBC driver I’m still hitting another error:

#15 2.573 Collecting pymssql==2.1.4
#15 2.597 Downloading pymssql-2.1.4.tar.gz (691 kB)
#15 2.887 ERROR: Command errored out with exit status 1:
#15 2.887 command: /usr/local/bin/python -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-wx3l7xs9/pymssql/setup.py’"’"’; file=’"’"’/tmp/pip-install-wx3l7xs9/pymssql/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base /tmp/pip-pip-egg-info-8pt2gqrw
#15 2.887 cwd: /tmp/pip-install-wx3l7xs9/pymssql/
#15 2.887 Complete output (7 lines):
#15 2.887 /usr/local/lib/python3.7/site-packages/setuptools/dist.py:42: DistDeprecationWarning: Do not call this function
#15 2.887 warnings.warn(“Do not call this function”, DistDeprecationWarning)
#15 2.887 Traceback (most recent call last):
#15 2.887 File “”, line 1, in
#15 2.887 File “/tmp/pip-install-wx3l7xs9/pymssql/setup.py”, line 88, in
#15 2.887 from Cython.Distutils import build_ext as _build_ext
#15 2.887 ModuleNotFoundError: No module named ‘Cython’
#15 2.887 ----------------------------------------
#15 2.887 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

executor failed running [/bin/sh -c if [ “x$skip_ds_deps” = “x” ] ; then pip install -r requirements_all_ds.txt ; else echo “Skipping pip install -r requirements_all_ds.txt” ; fi]: exit code: 1
ERROR: Service ‘server’ failed to build

Can you share your complete Dockerfile?

[EDIT] I ran into this issue as well but it was a typo in my Dockerfile. I don’t remember it exactly but perhaps I can spot it in yours.

Here is what my diff looks like (copied from yours)

Screen Shot 2021-03-29 at 3.26.03 PM

Gotcha. Try building the docker container with skip_ds_deps=1.

I was having the same issues here, and adding “ENV skip_ds_deps=1” to my Dockerfile above the pip install worked

1 Like

What are the consequences of removing Microsoft SQL Server and skip_ds_deps=1? Would this be safe to deploy to production? I assume it would cause issues if you’re using Microsoft SQL Server also all the database connectors for the items skipped in requirements_all_ds.txt?

Right. You could also just carve out the dependencies that cause build errors.

after doing → npm run build (I am getting the following error). its complaining about node engine. Any advise. Thanks!!

redash-client@9.0.0-beta build
yarn clean && yarn build:viz && NODE_ENV=production webpack
yarn run v1.22.10
error redash-client@9.0.0-beta: The engine “node” is incompatible with this module. Expected version “^14.16.1”. Got “16.6.1”

error Commands cannot run with an incompatible environment.
info Visit yarn run | Yarn for documentation about this command.

Are you in the right thread? It looks like you’re using redash-client which is an NPM module. This thread is about running the Redash application itself.