aws-toolkit-eclipse icon indicating copy to clipboard operation
aws-toolkit-eclipse copied to clipboard

Not able to launch AWS SAM LOCAL in MAC because of NPE

Open jfuss opened this issue 4 years ago • 5 comments

Copy from: https://github.com/awslabs/aws-sam-cli/issues/1419

Description

Unable to launch AWS SAM LOCAL on MAC with eclipse due to a NPE.

  1. Create the Hello World App in Eclipse, with out any modification.
  2. Follow the steps to install SAM Local
  3. Re launched Eclipse
  4. Right click on the java file and select "Run as" -> "AWS SAM Local"
  5. waited for a bit and then I get a NPE.

Steps to reproduce

Provide steps to replicate.

Observed result

I noticed that I can correctly invoke the app by launching it from the SAM cmd line as such:

  1. sam local start-lambda -t serverless.template
  2. aws lambda invoke --function-name "HelloWorld" --endpoint-url "http://127.0.0.1:3001" --no-verify-ssl out.txt
  3. Output is:
    {
        "StatusCode": 200
    }
    

Details of software:

  1. OS: 10.14.5 (18F132)
  2. sam --version: AM CLI, version 0.22.0
  3. DOCKER-desktop: 2.1.0.3

Eclipse LOG

eclipse.buildId=4.12.0.I20190605-1800
java.version=12.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Framework arguments:  -product org.eclipse.epp.package.jee.product -keyring /Users/Angel/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/Angel/.eclipse_keyring

com.amazonaws.eclipse.lambda
Error
Wed Sep 18 22:43:27 EDT 2019
Failed to launch SAM Local.

com.amazonaws.eclipse.core.exceptions.AwsActionException
	at com.amazonaws.eclipse.lambda.launching.SamLocalDelegate.launch(SamLocalDelegate.java:159)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:862)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:720)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1020)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1234)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException
	at com.amazonaws.eclipse.lambda.launching.SamLocalDelegate.buildSamLocalCommandLine(SamLocalDelegate.java:243)
	at com.amazonaws.eclipse.lambda.launching.SamLocalDelegate.launch(SamLocalDelegate.java:105)
	... 5 more

jfuss avatar Oct 18 '19 16:10 jfuss

How long will it take for someone to look into the issue? It took over a month for someone to look into the other issue. I know there is a lot of us out there.. just wondering if this is something simple or a complete bug, the fact that is a npe tell me is a bug... :)

arvera avatar Oct 19 '19 12:10 arvera

Hi @arvera, thanks for reaching out.

The Eclipse toolkit currently does not support the latest version of the SAM CLI. 1 2

We've been asking users to try out the AWS Toolkit for JetBrains

We'll mark this as a bug, but are there any limitations (technical or otherwise) keeping you on Eclipse?

rli avatar Oct 21 '19 23:10 rli

I am most familiar with the eclipse environment. I was an eclipse developer a few years back.. so.. is my natural habitat.

arvera avatar Oct 22 '19 02:10 arvera

I am having the same issue - with the accompanying code in the console log:

Traceback (most recent call last):
  File "/usr/local/bin/sam", line 11, in <module>
    load_entry_point('aws-sam-cli==0.31.0', 'console_scripts', 'sam')()
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/lib/telemetry/metrics.py", line 93, in wrapped
    raise exception  # pylint: disable=raising-bad-type
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/lib/telemetry/metrics.py", line 62, in wrapped
    return_value = func(*args, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/commands/local/invoke/cli.py", line 84, in cli
    parameter_overrides,
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/commands/local/invoke/cli.py", line 149, in do_cli
    context.function_name, event=event_data, stdout=context.stdout, stderr=context.stderr
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 98, in invoke
    self.local_runtime.invoke(config, event, debug_context=self.debug_context, stdout=stdout, stderr=stderr)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/local/lambdafn/runtime.py", line 83, in invoke
    self._container_manager.run(container)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/local/docker/manager.py", line 80, in run
    self.pull_image(image_name)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/samcli/local/docker/manager.py", line 124, in pull_image
    result_itr = self.docker_client.api.pull(image_name, stream=True, decode=True)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/api/image.py", line 396, in pull
    header = auth.get_config_header(self, registry)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/auth.py", line 48, in get_config_header
    client._auth_configs, registry, credstore_env=client.credstore_env
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/auth.py", line 324, in resolve_authconfig
    return authconfig.resolve_authconfig(registry)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/auth.py", line 235, in resolve_authconfig
    cfg = self._resolve_authconfig_credstore(registry, store_name)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/auth.py", line 262, in _resolve_authconfig_credstore
    store = self._get_store_instance(credstore_name)
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/auth.py", line 287, in _get_store_instance
    name, environment=self._credstore_env
  File "/usr/local/Cellar/aws-sam-cli/0.31.0/libexec/lib/python3.7/site-packages/docker/credentials/store.py", line 25, in __init__
    self.program
docker.credentials.errors.InitializationError: docker-credential-osxkeychain not installed or not available in PATH

In regards your question about JetBrains - the free edition is not sufficient for the work I do and the cost of the fully featured edition is prohibitive.

StuBramley avatar Nov 13 '19 10:11 StuBramley

Any update on this issue? I don't think changing IDEs is an acceptable workaround.

signari avatar Sep 10 '20 21:09 signari