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 Docker Image: ERR_INVALID_ARG_TYPE #774

Open
4 tasks done
oborchers opened this issue May 12, 2023 · 2 comments
Open
4 tasks done

Function Docker Image: ERR_INVALID_ARG_TYPE #774

oborchers opened this issue May 12, 2023 · 2 comments

Comments

@oborchers
Copy link

Are you certain it's a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest v3 release?

  • Yes, I'm using the latest v3 release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

If I try to provide an image for a function with name, command, and entryPoint I am unable to deploy the function.

If I remove all image related stuff and just provide and entrypoint I am able to deploy:

functions:
  aggregation:
    handler: handler_aggregation.handler_aggregation
    module: commons
    events:
      - httpApi:
          path: /get/aggregation
          method: get

Service configuration (serverless.yml) content

service: aggregation

frameworkVersion: '3'

provider:
  name: aws
  runtime: python3.8
  region: eu-west-1
  memorySize: 256
  ecr:
    images:
      baseimage:
        path: ./

functions:
  aggregation:
    image:
      name: baseimage
      command:
      - handler_aggregation.handler_aggregation
      entryPoint:
      - '/lambda-entrypoint.sh'
    events:
      - httpApi:
          path: /get/aggregation
          method: get

plugins:
  - serverless-python-requirements

Command name and used flags

STAGE=development sls deploy

Command output

Environment: darwin, node 19.7.0, framework 3.27.0 (local) 3.30.1v (global), plugin 6.2.3, SDK 4.3.2
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at readFile (node:fs:393:10)
    at go$readFile (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/graceful-fs/graceful-fs.js:118:14)
    at Object.readFile (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/graceful-fs/graceful-fs.js:115:12)
    at Object.readFile (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/universalify/index.js:5:57)
    at Object.tryCatcher (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/util.js:16:23)
    at Object.ret [as readFileAsync] (eval at makeNodePromisifiedEval (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:14:23)
    at injectRequirements (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/serverless-python-requirements/lib/inject.js:23:6)
    at ServerlessPythonRequirements.injectAllRequirements (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/serverless-python-requirements/lib/inject.js:145:13)
    at ServerlessPythonRequirements.<anonymous> (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/serverless-python-requirements/index.js:222:43)
    at ServerlessPythonRequirements.tryCatcher (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues [as _onImmediate] (/Users/oliverborchers/Desktop/Programming.nosync/datapipelines/video_metrics/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:475:21)

Environment information

Running "serverless" from node_modules
Framework Core: 3.27.0 (local) 3.30.1 (global)
Plugin: 6.2.3
SDK: 4.3.2
@medikoo medikoo transferred this issue from serverless/serverless May 15, 2023
@kallelat
Copy link

I'm experiencing the exact same error - the only difference is using 3.31.0 version of the framework and node18.

@kallelat
Copy link

Just noticed, that with individually flag set to true the deploy works fine, ping @oborchers

package:
individually: true

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