Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Docker apple M1) Invalid mapping of address 0x40080f9000 in reserved address space below 0x400000000000 #668

Closed
kamilcglr opened this issue Jan 4, 2021 · 149 comments
Labels

Comments

@kamilcglr
Copy link

kamilcglr commented Jan 4, 2021

Hello,

After I pulled the mcr.microsoft.com/mssql/server:latest image, I have a weird error when I want to launch it.
How can I resolve that ? Thank you in advance.

docker run --platform linux/amd64 -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Passw0rd'  -v sql_server:/var/opt/mssql -p 1433:1433 -it mcr.microsoft.com/mssql/server:latest
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
/opt/mssql/bin/sqlservr: Invalid mapping of address 0x400976b000 in reserved address space below 0x400000000000. Possible causes:
1) the process (itself, or via a wrapper) starts-up its own running environment sets the stack size limit to unlimited via syscall setrlimit(2);
2) the process (itself, or via a wrapper) adjusts its own execution domain and flag the system its legacy personality via syscall personality(2);
3) sysadmin deliberately sets the system to run on legacy VA layout mode by adjusting a sysctl knob vm.legacy_va_layout.

It seems to be the same problem in this SO question : https://stackoverflow.com/questions/65398641/docker-connect-sql-server-container-non-zero-code-1

@kamilcglr kamilcglr changed the title Invalid mapping of address 0x40080f9000 in reserved address space below 0x400000000000 on docker for apple M1 (Docker apple M1) Invalid mapping of address 0x40080f9000 in reserved address space below 0x400000000000 Jan 4, 2021
@RS-Roshi
Copy link

Any luck?

@kamilcglr
Copy link
Author

kamilcglr commented Jan 12, 2021

Any luck?

Unfortunately, no.
But has suggested by u/slickvik4 in this_reddit_comment you can use azure sql edge image. This solution is not working at 100% I still have some issues with heavy request. I get the following error : "There is insufficient system memory in resource pool 'internal' to run this query".

@RS-Roshi
Copy link

I am also unable to connect to docker registry from my M1 Mac Air. I saw nobody is responding any solution to all these issue out there for new m1's

@daviduzumeri
Copy link

Also having this issue and it's basically the main thing blocking my org from being able to use M1s for development. I'm setting up a remote Ubuntu Docker host at home for this but it'd be really wonderful if this was fixable, even if just in QEMU x86 emulated mode in Docker (although an ARM64 native container would be incredible)

@kamilcglr
Copy link
Author

It has been more than a month and no one has a solution. Maybe it will get better with the next tech preview.

@bradwallen
Copy link

Watching this space as well.

@rgioia
Copy link

rgioia commented Feb 8, 2021

Any news?

@kamilcglr
Copy link
Author

kamilcglr commented Feb 8, 2021

An engineer from Docker said :
"The best fix for this would be for Microsoft to provide an arm64 image.
My guess is that this is a qemu emulation issue that won't be easy to debug or fix."

The best alternatives today are to use Azure SQL Edge or other database technologies such as mariadb or mysql which are multi arch.
Discussion from reddit

Any news?

@daviduzumeri
Copy link

If Microsoft devotes resources to an ARM64 image, I will eat my hat :(

@richardksizemore
Copy link

Yes i went the Azure SQL Edge route and no issues for my purpose. https://hub.docker.com/_/microsoft-azure-sql-edge

@sshashka
Copy link

sshashka commented Feb 8, 2021

Yes i went the Azure SQL Edge route and no issues for my purpose. https://hub.docker.com/_/microsoft-azure-sql-edge

could you please help me installing it? Because after this step: "sudo docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge" nothing happens

@rgioia
Copy link

rgioia commented Feb 8, 2021

I can install azure without any problems. My current problem is to be able to install sql-server to run a Ruby on Rails application with sql-server as adapter

@RS-Roshi
Copy link

RS-Roshi commented Feb 8, 2021

Yes i went the Azure SQL Edge route and no issues for my purpose. https://hub.docker.com/_/microsoft-azure-sql-edge

could you please help me installing it? Because after this step: "sudo docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge" nothing happens

running this command
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge

generates this result and it started on port 1433
344f7269f806c5db985c61ec78b1bf7e6398f8f398acc8ea694a741f0c3aace3

@nihirisuto
Copy link

Gave up on the Azure Edge image. Ran into the CLR error (I'd imagine quite a few DB's might depend on the CLR runtime). Saw Microsoft pulled CLR support for Azure Edge 4 years back due to a security risk and it never came back.

@SvyatovetsD
Copy link

Any progress on this? Azure SQL Edge works fine, but can't really use it due to lack of CLR support

@bradwallen
Copy link

Gave up on the Azure Edge image. Ran into the CLR error (I'd imagine quite a few DB's might depend on the CLR runtime). Saw Microsoft pulled CLR support for Azure Edge 4 years back due to a security risk and it never came back.

Same. I need CLR support.

@Gilbert1391
Copy link

Same issue here, is there any work around for this? I have an older MacBook where I can run the container, how can I connect to the db server from my M1? Both computers are connected to the same network. Any help would be much appreciated!

@nihirisuto
Copy link

Same issue here, is there any work around for this? I have an older MacBook where I can run the container, how can I connect to the db server from my M1? Both computers are connected to the same network. Any help would be much appreciated!

There’s no fix ATM until Microsoft fixes the image on their end. Won’t work with dockers preview that includes emulation for m1.

Best you can do is the azure edge image which is ARM compatible but you lose things like CLR runtime.

If you’re just doing simple stuff with small ish databases (I was learning with adventure works) you can pretty easily spin up a mssql server on the free google cloud tier and upload your database to a bucket there, whitelist the IP you’ll be connecting from and connect to it there. That’s what I ended up doing so I could continue my learning

@rgioia
Copy link

rgioia commented Mar 4, 2021

Any news?

@nljsystemJF
Copy link

nljsystemJF commented Mar 5, 2021

Yes i went the Azure SQL Edge route and no issues for my purpose. https://hub.docker.com/_/microsoft-azure-sql-edge

Azure SQL Edge works fine on my M1 Mac.
But unfortunately, sqlcmd tool is not available the ARM64 version of SQL Edge containers.

@aroon0808
Copy link

Any news?

@soccypowa
Copy link

soccypowa commented Mar 23, 2021

I don't know if this helps this issue move at all, but I realized that building a custom image starting with Ubuntu 18.04 you will run into this problem as soon as you install sqlserver on it...

@thisisthekap
Copy link

@soccypowa Does it work if you use the image based on Ubuntu 16.04 (e.g. the tag 2019-CU9-ubuntu-16.04)?

@thisisthekap
Copy link

@LuisBosquez @twright-msft @amvin87 Are you able to give us any insight on possible workarounds or an ETA for a possible fix?

@soccypowa
Copy link

soccypowa commented Mar 23, 2021

@thisisthekap Tried a few different starting points now, just for the "fun" of it, started with Ubuntu 16.04 and 18.04, tested both SQL 2107 and 2019, and to top it of I even built on CentOS 8 one last time... Still exits with the same error. I found a support article on MSFT about RHEL 7.4, it is the ball park of the same error, tried to, I am not very experienced with this, but to set the limits as pointed out in it, no success, SQL Server terminates and generates a core dump on RHEL 7.4 when you try to run mssql-conf. Even found this article that also is "kinda" the same MSSQL DOCKER ON UNRAID.

Must be something it does that either is not allowed by the tech preview itself or the fact that we are virtualizing amd64 hardware and that there is some limitation of what Apple thinks is ok.

@soccypowa
Copy link

There is a new RC released today, RC2, they have removed the preview banner at the bottom. Still though for our situation no cigar, tried both qemu and virtualization.framework, , official image as well as my custom build...
https://docs.docker.com/docker-for-mac/apple-m1/

@kovalbogdan95
Copy link

I want to suggest a temporary workaround for this issue by using Azure SQL container.

Here my docker-compose.yml config example:

  # Database instance
  mssql:
    image: mcr.microsoft.com/azure-sql-edge:latest
    container_name: mssql
    volumes:
      - events_mssql:/var/opt/mssql
      - ./setup.sql:/usr/config/setup.sql
    ports:
      - 1433:1433
    environment:
      - ACCEPT_EULA=Y
      - MSSQL_SA_PASSWORD=Passw@rd
      - MSSQL_PID=Developer
      - MSSQL_DB=events_service
      - MSSQL_USER=SA
      - MSSQL_PASSWORD=Passw@rd
      - MSSQL_DB_AUDIT_LOG=events_service_audit_log

volumes:
  events_mssql:

setup.sql file should be placed on the same level with the docker-compose.yml file

CREATE DATABASE $(MSSQL_DB);
CREATE DATABASE $(MSSQL_DB_AUDIT_LOG);
GO
USE $(MSSQL_DB);
GO
CREATE LOGIN $(MSSQL_USER) WITH PASSWORD = '$(MSSQL_PASSWORD)';
GO
CREATE USER $(MSSQL_USER) FOR LOGIN $(MSSQL_USER);
GO
ALTER SERVER ROLE sysadmin ADD MEMBER [$(MSSQL_USER)];
GO

Answer on StackOverflow: https://stackoverflow.com/questions/65398641/docker-connect-sql-server-container-non-zero-code-1/66919852#66919852

@thisisthekap
Copy link

@kovalbogdan95 Thanks to the insights,
But unfortunately, Azure SQL Edge does not support Full Text Search and a bunch of other more or less widely used features.

@kovalbogdan95
Copy link

@thisisthekap Sure, I'd rather run MSSQL container too, but for time being it's everything we got.

@gohokies
Copy link

gohokies commented May 9, 2023

I run both mcr.microsoft.com/mssql/server:2022-latest and mcr.microsoft.com/mssql/server:2019-latest images successfully on M1 macbook with "Use Rosetta for x86/amd64 emulation on Apple Silicon" feature enabled in Docker Desktop V4.19.0.

@nagyDarius
Copy link

Hi, I'm trying to run this on the latest versions:
Docker v4.19.0
MacOS Ventura 13.3.1

But enabling the rosetta option results in this log when running the container.

2023-05-17 15:33:31 -- Not first container startup --
2023-05-17 15:33:33 rosetta error: unexpected BrkKind 17 on SIGTRAP

Any ideas why?

jbertran pushed a commit to DataDog/dd-trace-js that referenced this issue May 17, 2023
The standard mssql server image does not work on ARM [1].

Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
of mssql server API to test most of our integration.

Unfortunately, this image does not support stored procedures [3], so
tests related to these will still fail locally.

[1] microsoft/mssql-docker#668
[2] https://hub.docker.com/_/microsoft-azure-sql-edge
[3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
jbertran pushed a commit to DataDog/dd-trace-js that referenced this issue May 30, 2023
The standard mssql server image does not work on ARM [1].

Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
of mssql server API to test most of our integration.

Unfortunately, this image does not support stored procedures [3], so
tests related to these will still fail locally.

[1] microsoft/mssql-docker#668
[2] https://hub.docker.com/_/microsoft-azure-sql-edge
[3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
jbertran pushed a commit to DataDog/dd-trace-js that referenced this issue May 30, 2023
The standard mssql server image does not work on ARM [1].

Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
of mssql server API to test most of our integration.

Unfortunately, this image does not support stored procedures [3], so
tests related to these will still fail locally.

[1] microsoft/mssql-docker#668
[2] https://hub.docker.com/_/microsoft-azure-sql-edge
[3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
jbertran pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 8, 2023
The standard mssql server image does not work on ARM [1].

Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
of mssql server API to test most of our integration.

Unfortunately, this image does not support stored procedures [3], so
tests related to these will still fail locally.

[1] microsoft/mssql-docker#668
[2] https://hub.docker.com/_/microsoft-azure-sql-edge
[3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
jbertran added a commit to DataDog/dd-trace-js that referenced this issue Jun 14, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
nsavoire pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 20, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
nsavoire pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 20, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
nsavoire pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 21, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
tlhunter pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 23, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
tlhunter pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 23, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
tlhunter pushed a commit to DataDog/dd-trace-js that referenced this issue Jun 23, 2023
* add v0 naming to tedious (mssql)
* add v1 naming to tedious (mssql)
* switch to a mostly working test sqlserver

  The standard mssql server image does not work on ARM [1].

  Instead, we use `azure-sql-edge` [2], which provides a sufficient subset
  of mssql server API to test most of our integration. 

  Unfortunately, this image does not support stored procedures [3], so
  tests related to these will still fail locally.

  [1] microsoft/mssql-docker#668
  [2] https://hub.docker.com/_/microsoft-azure-sql-edge
  [3] https://learn.microsoft.com/en-us/azure/azure-sql-edge/features#unsupported-features
@alexcastrodev
Copy link

This work for me:

version: '3.8'
services:
  mssql:
    image: mcr.microsoft.com/azure-sql-edge
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=Admin123@@
      - MSSQL_PID=Developer
    ports:
      - 1433:1433
    volumes:
      - ./data:/var/opt/mssql

@Rajesh2015
Copy link

Try this for Mac m1 docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=reallyStrongPwd123" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge

@dancosta-fed
Copy link

@dotnetemmanuel
Copy link

Would this work on Ubuntu on RPI Arm64?

@justincolangelobrs
Copy link

justincolangelobrs commented Jan 17, 2024

I am seeing in Docker Desktop version 4.26.1 that the setting is out of experimental and in the general area.

Improved x86 performance and fixed most common Rosetta issues

@Mathew-Estafanous
Copy link

I'm faced with a 301 Service Unavailable with any attempt I make to pull sql server.

cmd(s) I've tried:

docker pull mcr.microsoft.com/mssql/server:2022-latest

docker pull --platform linux/amd6 mcr.microsoft.com/mssql/server:2022-latest

docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=reallyStrongPwd123" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge

Response error:

docker: Error response from daemon: received unexpected HTTP status: 503 Service Unavailable.

Docker version:

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:04:20 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.26.1 (131620)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:15 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

I've made sure rosette emulation is on as well.
image

Any suggestions as to what I might be doing wrong?

@StrictLine
Copy link

I'm faced with a 301 Service Unavailable with any attempt I make to pull sql server.

cmd(s) I've tried:

docker pull mcr.microsoft.com/mssql/server:2022-latest

docker pull --platform linux/amd6 mcr.microsoft.com/mssql/server:2022-latest

docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=reallyStrongPwd123" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge

Response error:

docker: Error response from daemon: received unexpected HTTP status: 503 Service Unavailable.

Docker version:

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:04:20 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.26.1 (131620)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:15 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

I've made sure rosette emulation is on as well. image

Any suggestions as to what I might be doing wrong?

Your screenshot about the forgotten Rosetta setting saved my day, thanks!

My command (Mac Studio with M2 Max):
docker run --name "mssqlex03" --platform=linux/amd64 --hostname "mssqlex03" -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=strongPassword" -e "MSSQL_PID=Express" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests