serverless-dynamodb-local: Cannot launch DynamoDB on Mac M1 architecture
Actual Behaviour
When running dynamodb locally on my Macbook M1 Pro 2021 I get an unsatisifed link due to sqlite libs not being available for my archiecture:
Caused by: java.lang.UnsatisfiedLinkError: /foo/.dynamodb/DynamoDBLocal_lib/libsqlite4java-osx.dylib:
dlopen(/foo/.dynamodb/DynamoDBLocal_lib/libsqlite4java-osx.dylib, 0x0001): tried:
'/foo/.dynamodb/DynamoDBLocal_lib/libsqlite4java-osx.dylib'
(fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')),
'/usr/local/lib/libsqlite4java-osx.dylib' (no such file), '/usr/lib/libsqlite4java-osx.dylib' (no such file)
Expected Behaviour
Should start DynamoDB java program
Steps to reproduce it
Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.
LogCat for the issue
Provide logs for the crash here
Screenshots of the issue
Where-ever possible attach a screenshot of the issue.
Would you like to work on the issue?
Please let us know if you can work on it or the issue should be assigned to someone else.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 9
- Comments: 15 (3 by maintainers)
@helenabenatar, @VirtualVirtuoso, @RyanCCollins, @terozio, @ikeller96, @StampixSMO, @AndrewKeig, @patricksalazar
Hi all, Since we seem stuck on the maintainer trying to obtain credentials I published my forks of the two required modules so that people can move on with their business:
There are two ways to use the forks:
1. Reference my forked package on NPM
Replace your devDependency to
serverless-dynamodb-local
inpackage.json
with:NOTE Since serverless references plugins by name declared in
package.json
, this also means you must replace the plugin name inserverless.yml
:Note also that using
@
as the first character in a yaml string requires quotes to be present as well.2. Reference fork directly via
git+ssh
URIThis fetches the
serverless-dynamodb-local
module directly from my fork on github, which in turns uses the forked version ofdynamodb-localhost
which I’ve published to NPM as@henhal/dynamodb-localhost
. Since you may still name the pluginserverless-dynamodb-local
inpackage.json
, no need to rename the plugin inserverless.yml
.I hope the maintainers are OK with me doing this; I mean no disrespect but lots of people have been waiting for nearly 7 months for a version to be published now.
@henhal I can merge the PRs, but let me check who has the credentials for publishing to NPM and sort it out.
This module uses
dynamodb-localhost
to start the DynamoDB local Java program. I created an issue for adding support for dockerized DynamoDB, which resolves the problem: https://github.com/99x/dynamodb-localhost/issues/63 I also posted an early PR that fixes it. Feel free to vote on it if this would be a good setup for you too @AndrewKeig @patricksalazar @StampixSMOBumping this since I am stuck by the same issue. Appreciate you!
@VirtualVirtuoso It’s a shame this pair of PRs seem to have got stuck. All that’s needed is that
dynamodb-localhost
@0.0.10 is published so that I - or a maintainer - can make a PR to use that version from this repo. @AshanFernando I think you are the maintainer of dynamodb-localhost, would you mind publishing it so that we can proceed?In the meantime, could a workaround for you be to manually start DynamoDB directly using
docker
from the command line and then usenostart: true
for the plugin settings to prevent the plugin from attempting to use Java? Then you can at least use the functionality to create tables etc using the plugin while waiting for this to be released.@AshanFernando would it be possible to create a new release for this?
I think the necessary fix has been implemented in dynamodb-localhost with https://github.com/99x/dynamodb-localhost/pull/64
Is there anyone maintaining this project and willing to make a new release to get the necessary changes included? Now the readme of this project as been already updated to indicate that docker support is in place, but thats not the case for the latest version available from npm.