Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to start localstack #514

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

Closed
lyenliang opened this issue Dec 18, 2017 · 17 comments
Closed

Unable to start localstack #514

lyenliang opened this issue Dec 18, 2017 · 17 comments
Labels
type: bug Bug report

Comments

@lyenliang
Copy link

Hi, I get the following error when starting localstack using DEBUG=1 localstack start command:

Starting local dev environment. CTRL-C to quit.
Starting mock API Gateway (http port 4567)...
Starting mock DynamoDB (http port 4569)...
Starting mock SES (http port 4579)...
Starting mock Kinesis (http port 4568)...
Starting mock Redshift (http port 4577)...
Starting mock S3 (http port 4572)...
Starting mock CloudWatch (http port 4582)...
Starting mock CloudFormation (http port 4581)...
Starting mock SSM (http port 4583)...
Starting mock SQS (http port 4576)...
Error: Unable to access jarfile DynamoDBLocal.jar
Starting local Elasticsearch (http port 4571)...
Error: Unable to access jarfile /Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/infra/elasticmq/elasticmq-server.jar
Starting mock SNS (http port 4575)...
Starting mock DynamoDB Streams service (http port 4570)...
Starting mock Firehose service (http port 4573)...
Starting mock Route53 (http port 4580)...
Starting mock ES service (http port 4578)...
Starting mock Lambda service (http port 4574)...
Listening at http://:::4565
[2017-12-18T22:20:57,815][INFO ][o.e.n.Node               ] [] initializing ...
[2017-12-18T22:20:58,007][INFO ][o.e.e.NodeEnvironment    ] [8aN79QE] using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [129.7gb], net total_space [233.4gb], spins? [unknown], types [apfs]
[2017-12-18T22:20:58,008][INFO ][o.e.e.NodeEnvironment    ] [8aN79QE] heap size [483.3mb], compressed ordinary object pointers [true]
[2017-12-18T22:20:58,010][INFO ][o.e.n.Node               ] node name [8aN79QE] derived from node ID [8aN79QEjR7i96H_JhrkqkA]; set [node.name] to override
[2017-12-18T22:20:58,011][INFO ][o.e.n.Node               ] version[5.3.0], pid[40633], build[3adb13b/2017-03-23T03:31:50.652Z], OS[Mac OS X/10.13.1/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_131/25.131-b11]
* Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4562/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4579/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4563/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4577/ (Press CTRL+C to quit)
[2017-12-18T22:21:00,394][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [aggs-matrix-stats]
[2017-12-18T22:21:00,394][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [ingest-common]
[2017-12-18T22:21:00,395][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [lang-expression]
[2017-12-18T22:21:00,395][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [lang-groovy]
[2017-12-18T22:21:00,395][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [lang-mustache]
[2017-12-18T22:21:00,395][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [lang-painless]
[2017-12-18T22:21:00,395][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [percolator]
[2017-12-18T22:21:00,396][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [reindex]
[2017-12-18T22:21:00,396][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [transport-netty3]
[2017-12-18T22:21:00,396][INFO ][o.e.p.PluginsService     ] [8aN79QE] loaded module [transport-netty4]
[2017-12-18T22:21:00,397][INFO ][o.e.p.PluginsService     ] [8aN79QE] no plugins loaded
* Running on http://0.0.0.0:4583/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4580/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
* Running on http://0.0.0.0:4582/ (Press CTRL+C to quit)
[2017-12-18T22:21:03,425][INFO ][o.e.n.Node               ] initialized
[2017-12-18T22:21:03,426][INFO ][o.e.n.Node               ] [8aN79QE] starting ...
[2017-12-18T22:21:03,766][INFO ][o.e.t.TransportService   ] [8aN79QE] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300}
[2017-12-18T22:21:03,774][WARN ][o.e.b.BootstrapChecks    ] [8aN79QE] initial heap size [209715200] not equal to maximum heap size [524288000]; this can cause resize pauses and prevents mlockall from locking the entire heap
[2017-12-18T22:21:06,842][INFO ][o.e.c.s.ClusterService   ] [8aN79QE] new_master {8aN79QE}{8aN79QEjR7i96H_JhrkqkA}{Pnq8I1k9S7uTkhf0nMk6jQ}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-12-18T22:21:06,864][INFO ][o.e.h.n.Netty4HttpServerTransport] [8aN79QE] publish_address {127.0.0.1:4560}, bound_addresses {[fe80::1]:4560}, {[::1]:4560}, {127.0.0.1:4560}
[2017-12-18T22:21:06,868][INFO ][o.e.n.Node               ] [8aN79QE] started
[2017-12-18T22:21:06,873][INFO ][o.e.g.GatewayService     ] [8aN79QE] recovered [0] indices into cluster_state
2017-12-18T22:21:08:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eb87d0>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eb87d0>: Failed to establish a new connection: [Errno 61] Connection refused',))

2017-12-18T22:22:09:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109ed8d10>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109ed8d10>: Failed to establish a new connection: [Errno 61] Connection refused',))

2017-12-18T22:23:10:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109ed8d50>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109ed8d50>: Failed to establish a new connection: [Errno 61] Connection refused',))

2017-12-18T22:24:11:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109ed8f50>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109ed8f50>: Failed to establish a new connection: [Errno 61] Connection refused',))

2017-12-18T22:25:13:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eee190>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eee190>: Failed to establish a new connection: [Errno 61] Connection refused',))

2017-12-18T22:26:15:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eee390>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eee390>: Failed to establish a new connection: [Errno 61] Connection refused',))

2017-12-18T22:27:18:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eee590>: Failed to establish a new connection: [Errno 61] Connection refused',)) Traceback (most recent call last):
File "/Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/services/generic_proxy.py", line 201, in forward
    headers=forward_headers)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x109eee590>: Failed to establish a new connection: [Errno 61] Connection refused',))

I've read #241 and tried the following command to see if it can solve my problem, but it fails.

mv $TMPDIR/localstack.ddb.zip $TMPDIR/localstack.ddb.old.zip
pip install --no-cache --upgrade --user localstack
localstack start

I add --user option because I'm using macOS. (see #248 for how to install localstack on macOS)

It seems like that the error has something to do with DynamoDBLocal.jar. Because localstack cannot find this file.

Anyone knows how to solve this problem?

@thesurlydev
Copy link

I had the same issue on Ubuntu. I had to do the following then reinstall localstack to get things working:

rm -rf /usr/local/lib/python2.7/dist-packages/infra

@whummer
Copy link
Member

whummer commented Feb 4, 2018

Thanks for reporting @lyenliang . This looks like a transient installation error, for some reason the elasticmq-server.jar and DynamoDBLocal.jar files were not downloaded properly. Can you please try the fix suggested by @digitalsanctum :

rm -rf /Users/myName/Library/Python/2.7/lib/python/site-packages/localstack/infra
DEBUG=1 localstack start

@zar777
Copy link

zar777 commented May 21, 2018

Hi,

I have the same issue but when I run localstack inside the docker container. If I try locally instead, it works fine. Any suggestions?

@petrogko
Copy link

petrogko commented May 30, 2018

I have a similar issue while attempting to start kinesis on localstack within docker container.
There are no ports with 4565 being consumed.

localstack_1 | 2018-05-30T04:30:18:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4565): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd4025ee750>: Failed to establish a new connection: [Errno 111] Connection refused',)) Traceback (most recent call last): localstack_1 | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 201, in forward localstack_1 | headers=forward_headers) localstack_1 | File "/opt/code/localstack/.venv/lib/python2.7/site-packages/requests/api.py", line 112, in post localstack_1 | return request('post', url, data=data, json=json, **kwargs) localstack_1 | File "/opt/code/localstack/.venv/lib/python2.7/site-packages/requests/api.py", line 58, in request localstack_1 | return session.request(method=method, url=url, **kwargs) localstack_1 | File "/opt/code/localstack/.venv/lib/python2.7/site-packages/requests/sessions.py", line 508, in request localstack_1 | resp = self.send(prep, **send_kwargs) localstack_1 | File "/opt/code/localstack/.venv/lib/python2.7/site-packages/requests/sessions.py", line 618, in send localstack_1 | r = adapter.send(request, **kwargs) localstack_1 | File "/opt/code/localstack/.venv/lib/python2.7/site-packages/requests/adapters.py", line 508, in send localstack_1 | raise ConnectionError(e, request=request)

UPDATE*
For me this was thrown, and I'm not sure as to why, but - DATA_DIR="/tmp/localstack/data" was responsible for this error.
This was part of the docker-compose.yml file.

@tai2
Copy link

tai2 commented Jun 19, 2018

Same here.

In my case, it only occurred when launching all services and data persistency enabled.
So I tried to launch service only I needed, which is S3, then the error was disappeared and localstack successfully works.

@bismark
Copy link

bismark commented Jul 17, 2018

In case it's helpful for anyone, I was getting this error when running with DATA_DIR and found the issue after running with the --debug flag:

$ SERVICES=kinesis DATA_DIR=/tmp/localstack/data2 localstack --debug start
Starting local dev environment. CTRL-C to quit.
Starting mock Kinesis (http port 4568)...

<path to site-pacakages>/localstack/node_modules/levelup/lib/leveldown.js:31
throw requireError(e)
^
LevelUPError: Failed to require LevelDOWN (The module '<path to site-packages>/localstack/node_modules/leveldown/build/Release/leveldown.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 59. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).). Try `npm install leveldown` if it's missing

I was able to resolve it by running npm install in <path to site-packages>/localstack.

@ahanifztech
Copy link

$ localstack start

Starting local dev environment. CTRL-C to quit.
Starting mock API Gateway (http port 4567)...
Starting mock DynamoDB (http port 4569)...
Starting mock SES (http port 4579)...
Starting mock Kinesis (http port 4568)...
Starting mock Redshift (http port 4577)...
Starting mock S3 (http port 4572)...
Starting mock CloudWatch (http port 4582)...
Starting mock CloudFormation (http port 4581)...
Starting mock SSM (http port 4583)...
Starting mock SQS (http port 4576)...
Starting local Elasticsearch (http port 4571)...
Starting mock SNS (http port 4575)...
Starting mock DynamoDB Streams service (http port 4570)...
Starting mock Firehose service (http port 4573)...
Starting mock Route53 (http port 4580)...
Starting mock ES service (http port 4578)...
Starting mock Lambda service (http port 4574)...
2018-07-18T14:02:50:WARNING:infra.pyc: Service "elasticsearch" not yet available, retrying...
2018-07-18T14:02:53:WARNING:infra.pyc: Service "elasticsearch" not yet available, retrying...
Ready.
2018-07-18T14:03:29:ERROR:localstack.services.generic_proxy: Error forwarding request: expected string or buffer Traceback (most recent call last):
  File "/home/ahanif/.local/lib/python2.7/site-packages/localstack/services/generic_proxy.py", line 181, in forward
    path=path, data=data, headers=forward_headers)
  File "/home/ahanif/.local/lib/python2.7/site-packages/localstack/services/dynamodb/dynamodb_listener.py", line 35, in forward_request
    data = json.loads(to_str(data))
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer

on running command 'localstack start' it ran fine but when I hit any url like dynamodb localhost:4569 it throws error as shown above.

@akmalrasool
Copy link

akmalrasool commented Sep 24, 2018

$ localstack start

Starting local dev environment. CTRL-C to quit.
Starting mock API Gateway (http port 4567)...
Starting mock DynamoDB (http port 4569)...
Starting mock SES (http port 4579)...
Starting mock Kinesis (http port 4568)...
Starting mock Redshift (http port 4577)...
Starting mock S3 (http port 4572)...
Starting mock CloudWatch (http port 4582)...
Starting mock CloudFormation (http port 4581)...
Starting mock SSM (http port 4583)...
Starting mock SQS (http port 4576)...
Starting local Elasticsearch (http port 4571)...
Starting mock SNS (http port 4575)...
Starting mock DynamoDB Streams service (http port 4570)...
Starting mock Firehose service (http port 4573)...
Starting mock Route53 (http port 4580)...
Starting mock ES service (http port 4578)...
Starting mock Lambda service (http port 4574)...
2018-07-18T14:02:50:WARNING:infra.pyc: Service "elasticsearch" not yet available, retrying...
2018-07-18T14:02:53:WARNING:infra.pyc: Service "elasticsearch" not yet available, retrying...
Ready.
2018-07-18T14:03:29:ERROR:localstack.services.generic_proxy: Error forwarding request: expected string or buffer Traceback (most recent call last):
  File "/home/ahanif/.local/lib/python2.7/site-packages/localstack/services/generic_proxy.py", line 181, in forward
    path=path, data=data, headers=forward_headers)
  File "/home/ahanif/.local/lib/python2.7/site-packages/localstack/services/dynamodb/dynamodb_listener.py", line 35, in forward_request
    data = json.loads(to_str(data))
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer

on running command 'localstack start' it ran fine but when I hit any url like dynamodb localhost:4569 it throws error as shown above.

Hey could you resolve that issue ?
I am facing the same problem, couldnt get any help yet.
kindly let me now if there is any solution.
It will be really appericiative.
Thanks
AkmalRasool

@ahanifztech

@Danver97
Copy link

Danver97 commented Nov 1, 2018

@lyenliang After a lot of time waste looking everywhere for the solution I found the following.

Note: I'm using Win10 and WSL, I can't guarantee would be the same on a genuine linux distro.

After installing nodejs, npm, pip, java and localstack using:

pip install --no-cache --upgrade --user localstack

when running localstack start I had:

2018-07-18T14:03:29:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: ...

Using DEBUG=1 localstack start
I had between other debug lines:

[...]
Starting mock SQS (http port 4576)...
Error: Unable to access jarfile DynamoDBLocal.jar
Starting local Elasticsearch (http port 4571)...
[...]
Starting mock Lambda service (http port 4574)...
Listening at http://:::4565
Error: Unable to access jarfile /home/danver/.local/lib/python2.7/site-packages/localstack/infra/elasticmq/elasticmq-server.jar

Reading around I found that there are some files that have to be removed before reinstalling localstack. My problem was that none of the path indicated was existing in my environment
So I decided to have a look under /home/danver/.local/lib/python2.7/site-packages/localstack/infra that was indicated in the error message.
There I found these files and folders:

danver@Danver:~/.local/lib/python2.7/site-packages/localstack/infra$ dir
dynamodb  elasticmq  elasticsearch  localstack-utils-fat.jar

I decided to remove the whole infra directory using:

rm -rf /home/danver/.local/lib/python2.7/site-packages/localstack/infra

And running again DEBUG=1 localstack start, in the middle of lots of debug lines I found Ready. but also:

Error: Invalid or corrupt jarfile /home/danver/.local/lib/python2.7/site-packages/localstack/infra/elasticmq/elasticmq-server.jar

For now I don't need ElasticMQ, but obviously there are still some problems with that .jar file.

I can confirm that now when hitting localhost:4569 gives:

ERROR:localstack.services.generic_proxy: Error forwarding request: expected string or buffer

I believe this is a problem with the parameters of the get request maybe, isn't it?

Last update

I can say that despite of this error:

ERROR:localstack.services.generic_proxy: Error forwarding request: expected string or buffer

I send commands to DynamoDb, S3 and API Gateway using AWS cli and receive correct responses. So, everything seems working perfectly
Maybe the problems is as mentioned before:

I believe this is a problem with the parameters of the get request maybe, isn't it?

@jaiew
Copy link

jaiew commented Nov 21, 2018

I had this issue also and even after deleting the infra directory it still happened.

I'm running on Mac and found that the files were in the tmp directory under /var/folders/<path>/T

To find them just run:

find /var/folders/ -name 'elasticmq-server.jar' 2>/dev/null
find /var/folders/ -name 'localstack.ddb.zip' 2>/dev/null
find /var/folders/ -name 'localstack.es.zip' 2>/dev/null

Delete these files and the infra directory and then run localstack start and it should download the files again and set it up correctly.

@sotayamashita
Copy link

sotayamashita commented Nov 28, 2018

I solved the issue to delete the image and pull again. I hope it helps you πŸ‘

  • docker(18.09.0)
  • localstack (localstack/localstack:latest as 2018/11/28)

@EmilOJ
Copy link

EmilOJ commented Jan 3, 2019

I solved the issue by installing on JDK 8 and maven (my bad for not reading the prerequisits properly).

  • MacOS 10.14.2 (Mojave)

@brettcooper
Copy link

brettcooper commented Feb 18, 2019

I was having this same issue and simply deleting the local data/ folder mapped by $DATA_DIR, then starting Local Stack again fixed this problem for me.

@zar777
Copy link

zar777 commented Feb 19, 2019

I solved the issue. Basically I was zipping a file during the container initialization and that was causing me issues.

@edwards-will
Copy link

edwards-will commented May 25, 2019

In case it's helpful for anyone, I was getting this error when running with DATA_DIR and found the issue after running with the --debug flag:

$ SERVICES=kinesis DATA_DIR=/tmp/localstack/data2 localstack --debug start
Starting local dev environment. CTRL-C to quit.
Starting mock Kinesis (http port 4568)...

<path to site-pacakages>/localstack/node_modules/levelup/lib/leveldown.js:31
throw requireError(e)
^
LevelUPError: Failed to require LevelDOWN (The module '<path to site-packages>/localstack/node_modules/leveldown/build/Release/leveldown.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 59. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).). Try `npm install leveldown` if it's missing

I was able to resolve it by running npm install in <path to site-packages>/localstack.

Got the error after upgrading to a new nodejs version and for me, the solution was npm rebuild but this was the solution :)

@whummer
Copy link
Member

whummer commented Aug 25, 2019

Thanks all for posting the solutions here. Closing this issue as outdated/fixed. Please open a follow-up issue if the problem persists. Thanks

@sullivandl
Copy link

I'm behind the times, but hit this issue on MacOs and resolved with:

docker pull localstack/localstack

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

No branches or pull requests