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

inotify fails for Mac with M1 #6174

Closed
2 of 3 tasks
tpimenta-ionos opened this issue Feb 17, 2022 · 2 comments
Closed
2 of 3 tasks

inotify fails for Mac with M1 #6174

tpimenta-ionos opened this issue Feb 17, 2022 · 2 comments

Comments

@tpimenta-ionos
Copy link

tpimenta-ionos commented Feb 17, 2022

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

inotify to work for amd64 over arm64

Actual behavior

inotify only works for arm64

Information

  • macOS Version: 12.2.1 (21D62)
  • Intel chip or Apple chip: Apple M1 Pro
  • Docker Desktop Version: 4.5.0 (74594)

Same issue as #5321
I discovered trying to run Payara server, which fails with the following error:

#19 48.08   Exception while processing config bean changes : 
#19 48.08 java.lang.IllegalArgumentException: Filesystem WatchService is unavailable
#19 48.08 	at com.sun.enterprise.loader.DirWatcher.<init>(DirWatcher.java:112)
#19 48.08 	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
#19 48.08 	at com.sun.enterprise.loader.DirWatcher.forPath(DirWatcher.java:95)
#19 48.08 	at com.sun.enterprise.loader.DirWatcher.register(DirWatcher.java:87)
#19 48.08 	at com.sun.enterprise.loader.ASURLClassLoader$URLEntry.init(ASURLClassLoader.java:979)
#19 48.08 	at com.sun.enterprise.loader.ASURLClassLoader$URLEntry.<init>(ASURLClassLoader.java:964)
#19 48.08 	at com.sun.enterprise.loader.ASURLClassLoader.appendURL(ASURLClassLoader.java:270)
#19 48.08 	at com.sun.appserv.connectors.internal.api.ConnectorsClassLoaderUtil.createRARClassLoader(ConnectorsClassLoaderUtil.java:167)
#19 48.08 	at com.sun.appserv.connectors.internal.api.ConnectorsClassLoaderUtil.createRARClassLoader(ConnectorsClassLoaderUtil.java:117)
#19 48.08 	at com.sun.appserv.connectors.internal.api.ConnectorsClassLoaderUtil.getSystemRARClassLoaders(ConnectorsClassLoaderUtil.java:212)
#19 48.08 	at com.sun.appserv.connectors.internal.api.AppSpecificConnectorClassLoaderUtil.getSystemRARClassLoaders(AppSpecificConnectorClassLoaderUtil.java:449)
#19 48.08 	at com.sun.appserv.connectors.internal.api.ConnectorClassLoaderServiceImpl$1.run(ConnectorClassLoaderServiceImpl.java:107)
#19 48.08 	at com.sun.appserv.connectors.internal.api.ConnectorClassLoaderServiceImpl$1.run(ConnectorClassLoaderServiceImpl.java:104)
#19 48.08 	at java.base/java.security.AccessController.doPrivileged(Native Method)
#19 48.08 	at com.sun.appserv.connectors.internal.api.ConnectorClassLoaderServiceImpl.getConnectorClassLoader(ConnectorClassLoaderServiceImpl.java:104)
#19 48.08 	at com.sun.enterprise.v3.server.ClassLoaderHierarchyImpl.getConnectorClassLoader(ClassLoaderHierarchyImpl.java:124)
#19 48.08 	at org.glassfish.resourcebase.resources.listener.ResourceManager$PropertyChangeHandler.changed(ResourceManager.java:283)
#19 48.08 	at org.jvnet.hk2.config.ConfigSupport.sortAndDispatch(ConfigSupport.java:301)
#19 48.08 	at org.glassfish.resourcebase.resources.listener.ResourceManager.changed(ResourceManager.java:259)
#19 48.08 	at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:402)
#19 48.08 	at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:392)
#19 48.08 	at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:281)
#19 48.08 	at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:279)
#19 48.08 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
#19 48.08 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
#19 48.08 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
#19 48.08 	at java.base/java.lang.Thread.run(Thread.java:829)
#19 48.08 Caused by: java.io.IOException: Function not implemented
#19 48.08 	at java.base/sun.nio.fs.LinuxWatchService.<init>(LinuxWatchService.java:64)
#19 48.08 	at java.base/sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47)
#19 48.08 	at com.sun.enterprise.loader.DirWatcher.<init>(DirWatcher.java:110)
#19 48.08 	... 26 more
#19 48.08 |#]

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[FAIL] DD0017: can a VM be started? vm has not started: vm has not started
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?

Please investigate the following 1 issue:

1 : The test: can a VM be started?
    Failed with: vm has not started: vm has not started

Despite the fact it says the VM did not start it works...

Steps to reproduce the behavior

(same as #5321)

$ cat > main.c <<\EOF
#include <stdio.h>
#include <sys/inotify.h>

int main(void) {
  int ret = inotify_init();
  if (ret < 0) {
    fprintf(stderr, "error: inotify_init returns %d\n", ret);
    return 1;
  }
  fprintf(stderr, "success: inotify_init returns %d\n", ret);
  return 0;
}
EOF

$ docker run \
    --rm \
    -v "$(pwd):/test" \
    --platform linux/arm64 \
    ubuntu \
    bash -c 'apt-get -qq update; apt-get install -qqy gcc file > /dev/null; gcc test/main.c; file a.out; ./a.out'
debconf: delaying package configuration, since apt-utils is not installed
a.out: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=231770721930bbbab1a70e3818b774fb7227c56b, for GNU/Linux 3.7.0, not stripped
success: inotify_init returns 3

$ docker run \
    --rm \
    -v "$(pwd):/test" \
    --platform linux/amd64 \
    ubuntu \
    bash -c 'apt-get -qq update; apt-get install -qqy gcc file > /dev/null 2>&1; gcc test/main.c; file a.out; ./a.out'
a.out: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=93da39f71b708a41255158712761c57507b8ef56, for GNU/Linux 3.2.0, not stripped
error: inotify_init returns -1
@laurazard
Copy link
Member

This is a known issue and is documented here -- https://docs.docker.com/desktop/mac/apple-silicon/

However, attempts to run Intel-based containers on Apple silicon machines under emulation can crash as qemu sometimes fails to run the container. In addition, filesystem change notification APIs (inotify) do not work under qemu emulation. Even when the containers do run correctly under emulation, they will be slower and use more memory than the native equivalent.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants