dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug] [common] oshi compatibility issues cause it fail to boot on m1 mac

Open ronyang1985 opened this issue 4 years ago • 1 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

I use a macbook with m1 chip, when starting StandaloneServer, I get the following error

Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/k6/h_l1w_m53l76tkylxlc33q4h0000gn/T/jna-113105/jna1882043576609991586.tmp: dlopen(/private/var/folders/k6/h_l1w_m53l76tkylxlc33q4h0000gn/T/jna-113105/jna1882043576609991586.tmp, 0x0001): tried: '/private/var/folders/k6/h_l1w_m53l76tkylxlc33q4h0000gn/T/jna-113105/jna1882043576609991586.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna1882043576609991586.tmp' (no such file) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1950) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1832) at java.lang.Runtime.load0(Runtime.java:811) at java.lang.System.load(System.java:1088) at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:947) at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922) at com.sun.jna.Native.<clinit>(Native.java:190) at com.sun.jna.Pointer.<clinit>(Pointer.java:54) at com.sun.jna.Structure.<clinit>(Structure.java:2130) at oshi.hardware.platform.mac.MacCentralProcessor.<clinit>(MacCentralProcessor.java:53) at oshi.hardware.platform.mac.MacHardwareAbstractionLayer.getProcessor(MacHardwareAbstractionLayer.java:54) at org.apache.dolphinscheduler.common.utils.OSUtils.cpuUsage(OSUtils.java:136) at org.apache.dolphinscheduler.common.utils.HeartBeat.fillSystemInfo(HeartBeat.java:176) at org.apache.dolphinscheduler.common.utils.HeartBeat.encodeHeartBeat(HeartBeat.java:204) at org.apache.dolphinscheduler.server.registry.HeartBeatTask.getHeartBeatInfo(HeartBeatTask.java:71) at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.registry(MasterRegistryClient.java:498) at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.start(MasterRegistryClient.java:120) at org.apache.dolphinscheduler.server.master.MasterServer.run(MasterServer.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ... 18 common frames omitted

To fix this, we need upgrade oshi-core version , and modify some method calls in OSUtils to adapt the new api.

What you expected to happen

backend service can run on m1 chip system

How to reproduce

Start StandaloneServer on a m1 chip macbook

Anything else

No response

Version

dev

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

ronyang1985 avatar Feb 15 '22 06:02 ronyang1985

Hi:

  • Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
  • In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
  • If you haven't received a reply for a long time, you can subscribe to the developer's email,Mail subscription steps reference https://dolphinscheduler.apache.org/en-us/community/development/subscribe.html ,Then write the issue URL in the email content and send question to [email protected].

github-actions[bot] avatar Feb 15 '22 06:02 github-actions[bot]