Amplify-cli: Failed to start API Mock endpoint max retries hit

Created on 16 Aug 2019  路  9Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
When I run amplify mock, after a few seconds the following error is returned:

Failed to start API Mock endpoint Error: max retries hit for starting dynamodb emulator

and hangs indefinitely.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to latest amplify cli - 1.12.0
  2. Have an existing initialized Amplify project with node modules installed (node 12 in my case).
  3. Run amplify mock at the root directory.
  4. See error

Expected behavior
The command completes successfully and instructs the user on how to access the mock UI.

Desktop (please complete the following information):

  • OS: macOS Mojave

Additional context
Add any other context about the problem here.
npm start to run the side locally, and all other amplify commands seem to be working properly.

bug mock

Most helpful comment

Fixed!

brew cask install java

worked for me.

All 9 comments

Hey @keenode

I think this is related to this issue : https://github.com/aws-amplify/amplify-cli/issues/2037

Can you try installing lsof ?

Should be fixed with : https://github.com/aws-amplify/amplify-cli/pull/2061

@rakannimer Unfortunately, I've seen those other issues and have lsof installed already. :(
Still getting the error. Any ideas?

Thanks for the help so far!

@keenode do you have Java installed on your machine? Mock uses DynamoDBLocal internally which is a java package and not having Java would cause this to fail.

Could you try running which java and see if there is Java installed on your machine

Hi @yuth
Yes, I have had a version of java installed on my machine. I ran the command and it is located here:
/usr/bin/java

This is the version of Java I'm on:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)

Hello all!

I am also receiving this message. Similar java version to above.

Any further suggestions are appreciated.

Thanks!

Fixed!

brew cask install java

worked for me.

@BryceAMcDaniel The brew install for java worked for me as well!

Thank you so much! :)

This is not a user error. The error message should be fixed so that others will not run into the same issue.

this is still an issue in 4.26.0. See more info in #4670

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeanpaulcozzatti picture jeanpaulcozzatti  路  3Comments

davo301 picture davo301  路  3Comments

ReidWeb picture ReidWeb  路  3Comments

darrentarrant picture darrentarrant  路  3Comments

amlcodes picture amlcodes  路  3Comments