Skip to content
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

Runtime.ExitError: Cannot create directory ‘/var/task/var’: Read-only file system #7

Open
ecrmnn opened this issue Jul 10, 2019 · 2 comments

Comments

@ecrmnn
Copy link

ecrmnn commented Jul 10, 2019

I've deployed this to Lambda, but I get an error when invoking the function.
It looks like the issue is mkdir. How can I change the path.

CloudWatch

START RequestId: aa29cf83-7b5f-47a4-947d-4f3db5fdf179 Version: $LATEST
++ dirname /var/task/bootstrap
+ BASE=/var/task
+ EXE=/var/task/bin/hello_world_lambda
+ HOME=/tmp
+ export HOME
+ export RELEASE_READ_ONLY=true
+ RELEASE_READ_ONLY=true
+ export LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib:/var/task/lib/elixir_runtime-0.1.0/priv
+ LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib:/var/task/lib/elixir_runtime-0.1.0/priv
+ /var/task/bin/hello_world_lambda foreground
mkdir: cannot create directory ‘/var/task/var’: Read-only file system
END RequestId: aa29cf83-7b5f-47a4-947d-4f3db5fdf179
REPORT RequestId: aa29cf83-7b5f-47a4-947d-4f3db5fdf179	Duration: 315.32 ms	Billed Duration: 400 ms 	Memory Size: 128 MB	Max Memory Used: 13 MB	
RequestId: aa29cf83-7b5f-47a4-947d-4f3db5fdf179 Error: Runtime exited with error: exit status 1
Runtime.ExitError

Invoking from CLI

aws lambda invoke \
    --function-name HelloWorld \
    --region eu-north-1 \
    --log-type Tail \
    --payload '{"msg": "a fake request"}' \
    outputfile.txt

output.txt

> cat outputfile.txt

{"errorType":"Runtime.ExitError","errorMessage":"RequestId: 403e99d9-896d-4541-a913-0c45ac7debac Error: Runtime exited with error: exit status 1"}%

hello_world_lambda.ex

defmodule HelloWorldLambda do
  @moduledoc """
  Documentation for HelloWorldLambda.
  """

  @doc """
  Hello world.

  ## Examples

      iex> HelloWorldLambda.hello()
      :world

  """
  def hello(request, context) do
    """
    Hello World!
    Request: #{Kernel.inspect(request)}
    Context: #{Kernel.inspect(context)}
    """
    |> IO.puts()

    :ok
  end
end
@erald14
Copy link

erald14 commented Jan 5, 2021

did you find out whats happening?

@ecrmnn
Copy link
Author

ecrmnn commented Jan 6, 2021

Unfortunately not

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

No branches or pull requests

2 participants