Title: No such file error while using Custom Image for Lambda · Issue #768 · serverless/serverless-python-requirements · GitHub
Open Graph Title: No such file error while using Custom Image for Lambda · Issue #768 · serverless/serverless-python-requirements
X Title: No such file error while using Custom Image for Lambda · Issue #768 · serverless/serverless-python-requirements
Description: Are you certain it's a bug? Yes, it looks like a bug Are you using the latest plugin release? Yes, I'm using the latest plugin release Is there an existing issue for this? I have searched existing issues, it hasn't been reported yet Issu...
Open Graph Description: Are you certain it's a bug? Yes, it looks like a bug Are you using the latest plugin release? Yes, I'm using the latest plugin release Is there an existing issue for this? I have searched existing ...
X Description: Are you certain it's a bug? Yes, it looks like a bug Are you using the latest plugin release? Yes, I'm using the latest plugin release Is there an existing issue for this? I have searched e...
Opengraph URL: https://github.com/serverless/serverless-python-requirements/issues/768
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"No such file error while using Custom Image for Lambda","articleBody":"### Are you certain it's a bug?\n\n- [X] Yes, it looks like a bug\n\n### Are you using the latest plugin release?\n\n- [X] Yes, I'm using the latest plugin release\n\n### Is there an existing issue for this?\n\n- [X] I have searched existing issues, it hasn't been reported yet\n\n### Issue description\n\nWhen we've configured lambda with a custom docker image, and also configured python requirements layer using `serverless-python-requirements` (of course for custom image functions we can't attach a layer)\r\n\r\nHere expected to deploy the application without error, or at least show an error/warning to convey that layers are not supported for custom image functions, instead I got the error.\r\n\r\nHere better to add one validation, which will raise an error if we configure the layers for custom image functions.\n\n### Service configuration (serverless.yml) content\n\n```yaml\nservice: my-service\r\n\r\nuseDotenv: true\r\n\r\nprovider:\r\n name: aws\r\n runtime: python3.9\r\n stage: ${opt:stage, 'alpha'}\r\n apiName: ${self:service}\r\n region: ap-south-1\r\n memorySize: 512\r\n timeout: 60\r\n lambdaHashingVersion: 20201221\r\n endpointType: regional\r\n logs:\r\n restApi: true\r\n level: INFO\r\n deploymentBucket:\r\n blockPublicAccess: true\r\n name: ${env:CODE_DEPLOYMENT_BUCKET}\r\n maxPreviousDeploymentArtifacts: 3\r\n\r\nplugins:\r\n - serverless-python-requirements\r\n\r\ncustom:\r\n pythonRequirements:\r\n slim: true\r\n useDownloadCache: false\r\n useStaticCache: false\r\n layer:\r\n name: ${self:service}-${self:provider.stage}-requirements-python39\r\n description: Requirements Lambda layer for My Lambda Function\r\n compatibleRuntimes:\r\n - python3.9\r\n\r\n config:\r\n CODE_DEPLOYMENT_BUCKET: ${env:CODE_DEPLOYMENT_BUCKET}\r\n DOCKER_IMAGE_NAME: ${env:DOCKER_IMAGE_NAME}\r\n DOCKER_IMAGE_NAME_WITH_TAG_IN_ECR: ${aws:accountId}.dkr.ecr.${self:provider.region}.amazonaws.com/${self:custom.config.DOCKER_IMAGE_NAME}:${self:provider.stage}\r\n\r\nfunctions:\r\n debugger_handler:\r\n image: ${self:custom.config.DOCKER_IMAGE_NAME_WITH_TAG_IN_ECR}\r\n name: ${self:service}-${self:provider.stage}\r\n layers:\r\n - {Ref: PythonRequirementsLambdaLayer}\r\n events:\r\n - http:\r\n path: /mypath/\r\n method: post\r\n integration: lambda-proxy\r\n cors: true\n```\n\n\n### Command name and used flags\n\nserverless deploy --stage alpha\n\n### Command output\n\n```shell\n✖ Stack my-service-alpha failed to deploy (0s)\r\nEnvironment: linux, node 12.20.1, framework 3.26.0, plugin 6.2.2, SDK 4.3.2\r\nCredentials: Local, \"default\" profile\r\nDocs: docs.serverless.com\r\nSupport: forum.serverless.com\r\nBugs: github.com/serverless/serverless/issues\r\n\r\nError:\r\nError: ENOENT: no such file or directory, open '.serverless/requirements.txt'\r\n at Object.openSync (fs.js:462:3)\r\n at Object.readFileSync (fs.js:364:35)\r\n at module.exports (/home/ib-developer/node_modules/sha256-file/index.js:24:19)\r\n at sha256Path (/home/ib-developer/node_modules/serverless-python-requirements/lib/shared.js:134:10)\r\n at ServerlessPythonRequirements.zipRequirements (/home/ib-developer/node_modules/serverless-python-requirements/lib/layer.js:16:23)\r\n at ServerlessPythonRequirements.tryCatcher (/home/ib-developer/node_modules/bluebird/js/release/util.js:16:23)\r\n at Promise._settlePromiseFromHandler (/home/ib-developer/node_modules/bluebird/js/release/promise.js:547:31)\r\n at Promise._settlePromise (/home/ib-developer/node_modules/bluebird/js/release/promise.js:604:18)\r\n at Promise._settlePromiseCtx (/home/ib-developer/node_modules/bluebird/js/release/promise.js:641:10)\r\n at _drainQueueStep (/home/ib-developer/node_modules/bluebird/js/release/async.js:97:12)\r\n at _drainQueue (/home/ib-developer/node_modules/bluebird/js/release/async.js:86:9)\r\n at Async._drainQueues (/home/ib-developer/node_modules/bluebird/js/release/async.js:102:5)\r\n at Immediate.Async.drainQueues [as _onImmediate] (/home/ib-developer/node_modules/bluebird/js/release/async.js:15:14)\r\n at processImmediate (internal/timers.js:461:21)\r\n\r\n1 deprecation found: run 'serverless doctor' for more details\n```\n\n\n### Environment information\n\n```shell\nFramework Core: 3.26.0\r\nPlugin: 6.2.2\r\nSDK: 4.3.2\n```\n","author":{"url":"https://github.com/DilLip-Chowdary-Codes","@type":"Person","name":"DilLip-Chowdary-Codes"},"datePublished":"2023-04-29T06:53:24Z","url":"https://github.com/serverless/serverless-python-requirements/issues/768"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6840db23-4a05-1453-c785-2e9af1bcbb49 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A470:49A58:194619:21D2FC:6B042FEF |
| html-safe-nonce | 73556cb395d42f9451dca4b5943e68f70e51c279f5b07b7c5d578cdfded89f10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDcwOjQ5QTU4OjE5NDYxOToyMUQyRkM6NkIwNDJGRUYiLCJ2aXNpdG9yX2lkIjoiMTA5NzgwNjMxMjgwNjU1OTcyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c7e089798bbd293cd691d005ce31cc909c138ab9f923f35c99d24d2f5a4861d7 |
| hovercard-subject-tag | issue:1689423368 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/serverless/serverless-python-requirements/768/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e037222a0cfdc688e1c9bacaa67d9ecd6aa4933ee2fa732d3f126c52a7fa9014/serverless/serverless-python-requirements/issues/768 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e037222a0cfdc688e1c9bacaa67d9ecd6aa4933ee2fa732d3f126c52a7fa9014/serverless/serverless-python-requirements/issues/768 |
| og:image:alt | Are you certain it's a bug? Yes, it looks like a bug Are you using the latest plugin release? Yes, I'm using the latest plugin release Is there an existing issue for this? I have searched existing ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DilLip-Chowdary-Codes |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/serverless/serverless-python-requirements git https://github.com/serverless/serverless-python-requirements.git |
| octolytics-dimension-user_id | 13742415 |
| octolytics-dimension-user_login | serverless |
| octolytics-dimension-repository_id | 76508594 |
| octolytics-dimension-repository_nwo | serverless/serverless-python-requirements |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 76508594 |
| octolytics-dimension-repository_network_root_nwo | serverless/serverless-python-requirements |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width