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 image crashing on m1 mac #15

Closed
dlamoris opened this issue Nov 9, 2023 · 3 comments · Fixed by #16
Closed

docker image crashing on m1 mac #15

dlamoris opened this issue Nov 9, 2023 · 3 comments · Fixed by #16

Comments

@dlamoris
Copy link
Contributor

dlamoris commented Nov 9, 2023

when trying to run latest flexo-mms-store-service image on m1 mac, got this

Exception in thread "main" java.io.IOException: Function not implemented
store-service    | 	at java.base/sun.nio.fs.LinuxWatchService.<init>(LinuxWatchService.java:62)
store-service    | 	at java.base/sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$watcher$2.invoke(ApplicationEngineEnvironmentReloading.kt:81)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$watcher$2.invoke(ApplicationEngineEnvironmentReloading.kt:79)
store-service    | 	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.getWatcher(ApplicationEngineEnvironmentReloading.kt:79)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.cleanupWatcher(ApplicationEngineEnvironmentReloading.kt:364)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:281)
store-service    | 	at io.ktor.server.cio.CIOApplicationEngine$initServerJob$1$2.invokeSuspend(CIOApplicationEngine.kt:207)
store-service    | 	at io.ktor.server.cio.CIOApplicationEngine$initServerJob$1$2.invoke(CIOApplicationEngine.kt)
store-service    | 	at io.ktor.server.cio.CIOApplicationEngine$initServerJob$1$2.invoke(CIOApplicationEngine.kt)
store-service    | 	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
store-service    | 	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
store-service    | 	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
store-service    | 	at io.ktor.server.cio.CIOApplicationEngine$initServerJob$1.invokeSuspend(CIOApplicationEngine.kt:206)
store-service    | 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
store-service    | 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
store-service    | 	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
store-service    | 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
store-service    | 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
store-service    | 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
store-service    | 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
store-service    | 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
store-service    | 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [LazyStandaloneCoroutine{Cancelling}@6bd61f98, Dispatchers.IO]
store-service    | Exception in thread "DefaultDispatcher-worker-2" java.io.IOException: Function not implemented
store-service    | 	at java.base/sun.nio.fs.LinuxWatchService.<init>(LinuxWatchService.java:62)
store-service    | 	at java.base/sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$watcher$2.invoke(ApplicationEngineEnvironmentReloading.kt:81)
store-service    | 	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$watcher$2.invoke(ApplicationEngineEnvironmentReloading.kt:79)
store-service    | 	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)

this doesn't happen with layer1 service or auth service, there's probably some config that's causing this to be platform specific

@dlamoris dlamoris added this to Flexo Nov 9, 2023
@github-project-automation github-project-automation bot moved this to New in Flexo Nov 9, 2023
@dlamoris dlamoris moved this from New to In Progress in Flexo Nov 9, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Flexo Nov 16, 2023
@dlamoris dlamoris reopened this Nov 16, 2023
@dlamoris
Copy link
Contributor Author

turns out netty also running into same issue

Exception in thread "main" java.io.IOException: Function not implemented
store-service    |      at java.base/sun.nio.fs.LinuxWatchService.<init>(LinuxWatchService.java:62)
store-service    |      at java.base/sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47)
store-service    |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$watcher$2.invoke(ApplicationEngineEnvironmentReloading.kt:81)
store-service    |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$watcher$2.invoke(ApplicationEngineEnvironmentReloading.kt:79)
store-service    |      at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
store-service    |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.getWatcher(ApplicationEngineEnvironmentReloading.kt:79)
store-service    |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.cleanupWatcher(ApplicationEngineEnvironmentReloading.kt:364)
store-service    |      at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:281)
store-service    |      at io.ktor.server.netty.NettyApplicationEngine.start(NettyApplicationEngine.kt:216)
store-service    |      at io.ktor.server.netty.EngineMain.main(EngineMain.kt:23)

at this point not sure what's different about store-service that's causing this, since auth and layer1 are both working and they have pretty much the same ktor/engine configurations

@dlamoris
Copy link
Contributor Author

we know it's related to docker desktop issue, but that doesn't explain why auth and layer1 is working...
the reloading seems to be related to a development flag, but those have been taken out
related issues/articles
docker/for-mac#6174
https://blog.arkey.fr/2019/09/13/watchservice-and-bind-mount/

@dlamoris
Copy link
Contributor Author

The mystery is solved - what actually happened:

When testing with the docker-compose at https://github.com/Open-MBEE/flexo-mms-deployment/tree/develop/docker-compose, the store service on mac crashes with the above error. This error is a known docker for mac issue.

What actually led to the the error being thrown is another exception during application startup when s3 client is being initialized. The deployment repo had a misconfigured env var for s3 that's causing s3 client to fail when looking for aws credentials. This exception is shown on a linux machine running that compose file. It's swallowed/hidden by the docker for mac exception when ran on mac and i believe windows.

Fixing the env var in deployment repo fixes that compose and store service no longer crash.

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

Successfully merging a pull request may close this issue.

1 participant