跳至内容

aws.greengrass.clientdevices.mqtt.EMQX fails on Windows

0

Basic deployment for the new EMQX MQTT Broker (https://docs.aws.amazon.com/greengrass/v2/developerguide/mqtt-broker-emqx-component.html) fails on Windows

The EMQX log is failing w/ a Windows Credentials error:

2022-08-19T20:29:26.491Z [INFO] (pool-2-thread-63) aws.greengrass.clientdevices.mqtt.EMQX: shell-runner-start. {scriptName=services.aws.greengrass.clientdevices.mqtt.EMQX.lifecycle.startup.script, serviceName=aws.greengrass.clientdevices.mqtt.EMQX, currentState=STARTING, command=["C:\greengrass\v2\packages\artifacts-unarchived\aws.greengrass.clientdevices.mq..."]}
2022-08-19T20:29:26.492Z [ERROR] (pool-2-thread-63) aws.greengrass.clientdevices.mqtt.EMQX: shell-runner-error. Error while running process. {scriptName=services.aws.greengrass.clientdevices.mqtt.EMQX.lifecycle.startup.script, serviceName=aws.greengrass.clientdevices.mqtt.EMQX, currentState=STARTING, command=["C:\greengrass\v2\packages\artifacts-unarchived\aws.greengrass.clientdevices.mq..."]}
java.io.IOException: Failed to read credential
	at vendored.com.microsoft.alm.storage.windows.internal.WindowsCredUtils.read(WindowsCredUtils.java:36)
	at com.aws.greengrass.util.platforms.windows.WindowsExec.getPassword(WindowsExec.java:298)
	at com.aws.greengrass.util.platforms.windows.WindowsExec.createProcess(WindowsExec.java:116)
	at com.aws.greengrass.util.Exec.exec(Exec.java:316)
	at com.aws.greengrass.util.Exec.background(Exec.java:373)
	at com.aws.greengrass.lifecyclemanager.ShellRunner$Default.successful(ShellRunner.java:110)
	at com.aws.greengrass.lifecyclemanager.GenericExternalService.run(GenericExternalService.java:683)
	at com.aws.greengrass.lifecyclemanager.GenericExternalService.run(GenericExternalService.java:701)
	at com.aws.greengrass.lifecyclemanager.GenericExternalService.run(GenericExternalService.java:629)
	at com.aws.greengrass.lifecyclemanager.GenericExternalService.startup(GenericExternalService.java:343)
	at com.aws.greengrass.lifecyclemanager.Lifecycle.lambda$handleStateTransitionStartingToRunningAsync$9(Lifecycle.java:530)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: com.sun.jna.LastErrorException: [1168] Element not found.
	at com.sun.jna.Native.invokeInt(Native Method)
	at com.sun.jna.Function.invoke(Function.java:426)
	at com.sun.jna.Function.invoke(Function.java:361)
	at com.sun.jna.Library$Handler.invoke(Library.java:265)
	at com.sun.proxy.$Proxy30.CredRead(Unknown Source)
	at vendored.com.microsoft.alm.storage.windows.internal.WindowsCredUtils.read(WindowsCredUtils.java:31)
	... 15 more
  • Hi, the log which you have posted doesn't contain any errors. Can you provide the EMQX component log file?

    I may also recommend opening a support case through the AWS Console for better private support.

  • One reason why it may fail on startup is if you have an existing program using the same port (8883). Similarly, the Windows firewall (if enabled) may stop things from functioning properly. You can use the following command as an administrator to enable inbound MQTT connections to port 8883. New-NetFirewallRule -DisplayName "Allow MQTT" -Direction Inbound -Protocol TCP -LocalPort 8883 -Action Allow

  • I have updated the original post to include the EMQX log (apologies, I thought it was captured in the greengrass.log). Thanks for your help, happy to open a private support ticket if needed

已提问 3 年前804 查看次数
1 回答
1
已接受的回答

The error "failed to read credential" means that Greengrass was not able to find the password for the component's runWith user. This does not only apply to EMQX, but to any component which runs an external process. This happens when Greengrass is not running as the user which our instructions would have you run it, or if you did not create and store a user's password following: https://docs.aws.amazon.com/greengrass/v2/developerguide/quick-installation.html

If Greengrass is running as a Windows system service, which is what our instructions will have you do, then the user's password must be stored in the LOCAL_SYSTEM account's credential store. Our instructions have you store the password using the PsExec utility, so see that portion of the instructions to make sure that you've followed that.

If you aren't running Greengrass as a system service, then you should stop Greengrass and instead run it as a system service.

AWS
专家
已回答 3 年前
专家
已审核 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。