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

Function stuck in pending state #5

Closed
ghost opened this issue Jan 24, 2022 · 2 comments
Closed

Function stuck in pending state #5

ghost opened this issue Jan 24, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2022

It worked at the first go.

Then I've added some other tooling to the Dockerfile and used this command to rebuild the Docker:

lithops runtime build sc-runtime -f Dockerfile

Since then, I'm not able anymore to run the program. Even Lithops test fails me:

lithops test
2022-01-24 10:46:09,925 [INFO] lithops.config -- Lithops v2.5.8
2022-01-24 10:46:10,081 [INFO] lithops.storage.backends.aws_s3.aws_s3 -- S3 client created - Region: eu-west-3
2022-01-24 10:46:10,124 [INFO] lithops.serverless.backends.aws_lambda.aws_lambda -- AWS Lambda client created - Region: eu-west-3
2022-01-24 10:46:10,125 [INFO] lithops.invokers -- ExecutorID d5971d-0 | JobID A000 - Selected Runtime: python38 - 512MB
2022-01-24 10:46:10,218 [INFO] lithops.invokers -- Runtime python38 with 512MB is not yet installed
2022-01-24 10:46:10,311 [INFO] lithops.serverless.backends.aws_lambda.aws_lambda -- Creating default lambda layer for runtime python38
Traceback (most recent call last):
  File "/root/tools/ShadowClone/test/bin/lithops", line 8, in <module>
    sys.exit(lithops_cli())
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/lithops/scripts/cli.py", line 168, in test_function
    fexec.call_async(hello, username)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/lithops/executors.py", line 205, in call_async
    runtime_meta = self.invoker.select_runtime(job_id, runtime_memory)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/lithops/invokers.py", line 121, in select_runtime
    runtime_meta = self.compute_handler.create_runtime(self.runtime_name, runtime_memory, runtime_timeout)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/lithops/serverless/serverless.py", line 73, in create_runtime
    return self.backend.create_runtime(runtime_name, memory, timeout=timeout)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/lithops/serverless/backends/aws_lambda/aws_lambda.py", line 413, in create_runtime
    layer_arn = self._create_layer(runtime_name)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/lithops/serverless/backends/aws_lambda/aws_lambda.py", line 200, in _create_layer
    response = self.lambda_client.invoke(
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/botocore/client.py", line 391, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/root/tools/ShadowClone/test/lib/python3.8/site-packages/botocore/client.py", line 719, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.ResourceConflictException: An error occurred (ResourceConflictException) when calling the Invoke operation: The operation cannot be performed at this time. The function is currently in the following state: Pending

Already tried:

  • Remove runtime reference in config.py
  • Remove lambda function manually in console
  • Remove S3 bucket and create a new one and add new one in config
  • Changing AWS region

Would really appreciate some guidance in how to proceed when editing the Dockerfile

@vysecurity
Copy link
Contributor

Where's the Dockerfile? I can't even see what you added.

@fyoorer
Copy link
Owner

fyoorer commented Jan 24, 2022

After adding your tools you should run the lithops runtime build ... and lithops runtime create ... command again.
Also make sure you give a new name to the runtime when running the command again like this:

lithops runtime build sc-runtime1 -f Dockerfile

lithops runtime create sc-runtime1 --memory 512 --timeout 300

Then update config.py with the new runtime name. This should solve it.

@ghost ghost closed this as completed Jan 24, 2022
This issue was closed.
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