The "options" or "port" or "path" argument must be specified

I am trying to let serverless create a bucket with a lambda function that listens to a Bucket event. So following the docs i have this function block in my serverless.yml

functions:
  my-function:
    handler: build/my-handler
      events:
        - s3:
          bucket: my-bucket
          event: s3:ObjectCreated:*

When i now try to deploy, i always get “The “options” or “port” or “path” argument must be specified” as error message.

Where do i need to add what arguement?

EDIT: I’m using Framework Version: 2.30.3

Hi,
am also getting this error with a serverless deploy.
The issue occurs when I am using an exported https_proxy. Without the proxy, everything works fine.
Using Framework version 2.30.3.

Remark:
The useDotEnv variable within serverless.yml is set to true in my case.
plugins used:

  • serverless-webpack
  • serverless-appsync

.

Think I found the root cause.
Workaround: pin the serverless version to 2.29.0.
With latest releases a new file lib/aws/request.js
was introduced.
Inside those changes URL is used not url anymore.
The url.parse command returned an object with a path property. the URL object does not have the path property.
Was not able to proove that yet.

Created a bug ticket: The “options” or “port” or “path” argument must be specified when using https_proxy version 2.30.* · Issue #9146 · serverless/serverless · GitHub

@Lars1 my issue was related with setting https_proxy.
The bug was introduced to the serverless framework with version 2.30.0.
There was a PR 9147 which should solve that issue. It is merged to master but not included into a new release (think it will be part of 2.30.4).

Am not sure if that problem is also related to your case. If you use a proxy, then downgrading to 2.29.* should solve your issue (or wait until the hotfix is added into a new release).

1 Like

That was exactly our problem. We pinned the version to 2.29.0 and are waiting for a new version to be released.