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

Value null at 'createStageInput.deploymentId' #15

Closed
timoteialbu opened this issue Aug 13, 2018 · 22 comments
Closed

Value null at 'createStageInput.deploymentId' #15

timoteialbu opened this issue Aug 13, 2018 · 22 comments

Comments

@timoteialbu
Copy link

Hey,

I was following this article which suggested using your plugin, but when I try deploying I get the following error:
An error occurred: ApiGatewayStage - 1 validation error detected: Value null at 'createStageInput.deploymentId' failed to satisfy constraint: Member must not benull (Service: AmazonApiGateway; Status Code: 400; Error Code: ValidationException; Request ID: b4a97ac8-9f17-11e8-ad43-2f6b195fc4e8).

Any thoughts? Why is that variable not exported? Do you think its an issue with the plugin or on serverless side?

Thanks for your time,

Timotei

@svdgraaf
Copy link
Owner

I think that's a recent change in CF, see also #14 whcih I think is the same issue, I'll look into it.

@svdgraaf
Copy link
Owner

Just noticed, that's actually you refering to it ;)

@svdgraaf
Copy link
Owner

Can you post the output of the AWS::ApiGateway::Stage resource in your cloudformation file in the .serverless directory? It should have the deployment Id filled in, but could be something changed in a recent version of Serverless.

@timoteialbu
Copy link
Author

Thanks for getting back to me so quick!

This is what I have in the cloudformation-template-update-stack.json:

"ApiGatewayStage": {
      "Type": "AWS::ApiGateway::Stage",
      "Properties": {
        "RestApiId": {
          "Ref": "ApiGatewayRestApi"
        },
        "MethodSettings": [
          {
            "DataTraceEnabled": true,
            "HttpMethod": "*",
            "LoggingLevel": "INFO",
            "ResourcePath": "/*",
            "MetricsEnabled": true
          }
        ]
      }
    }

@markforcepoint
Copy link

As a workaround I used the serverless-plugin-bind-deployment-id (https://github.com/jacob-meacham/serverless-plugin-bind-deployment-id) To insert the deploymentId

      Type: 'AWS::ApiGateway::Stage'
      Properties:
        DeploymentId:
          Ref: __deployment__
        RestApiId:
          Ref: ApiGatewayRestApi
        StageName: ${self:provider.stage}
        MethodSettings:
         - DataTraceEnabled: true
           HttpMethod: "*"
           LoggingLevel: INFO
           ResourcePath: "/*"
           MetricsEnabled: true

@johnnyplaydrums
Copy link

Hey, any movement on this issue? Just ran into it as well

@svdgraaf
Copy link
Owner

I don't have any time currently to work on this, some help (or PR) is greatly appreciated...

@johnnyplaydrums
Copy link

Cool no worries, I’ll try to carve out some time for it. Thanks!

@chrisyorkston
Copy link

Just hit this issue, is there any update? Thanks

@dsmileym4
Copy link

just hit this issue today as well.

@mdgreenwald
Copy link

Also encountering this issue.

@dmhalejr
Copy link
Contributor

Hey I think I know what the issue is here. I'd like to claim this issue.

@svdgraaf
Copy link
Owner

I just released 1.8.1 with @dmhalejr fix in it. Please check if this resolves your issue.

@robinweston
Copy link

I'm afraid that @dmhalejr 's fix doesn't work. It actually makes things a bit worse. TestDeployment is just a dummy value used in an AWS Guide. The accepted PR hardcodes the DeploymentId to this value so there is no hope of matching up to the correct (random) deployment Id. I am investigating why the correct Deployment Id isn't picked up as the code looks sound

@robinweston
Copy link

Ok, so I've got to the bottom of it.

@dmhalejr 's PR has no effect as the DeploymentId is immediately overwritten by stageConfig.Properties.DeploymentId = {"Ref":key}

The null DeploymentId was happening for me simply because the plugin hook never fired. This is fixed by this PR and just needs publishing as a new version to npm

@jamesallardice
Copy link

@svdgraaf Any chance you could publish the latest changes to npm? As per the last comment on this issue, there's a change in master which resolves an issue but is not published. It's easy to work around by installing the package directly from GitHub but it would be preferable to use the registry with proper semver.

@svdgraaf
Copy link
Owner

svdgraaf commented Dec 4, 2018

@jamesallardice oh crap, did I not publish it? on it!

@svdgraaf
Copy link
Owner

svdgraaf commented Dec 4, 2018

I have pushed version 1.8.2 to npm!

@jamesallardice
Copy link

jamesallardice commented Dec 4, 2018

🎉 thanks for the quick turnaround @svdgraaf!

@limaneto
Copy link

limaneto commented Apr 1, 2019

Still facing this issue, is this problem still around?

@svdgraaf
Copy link
Owner

svdgraaf commented Apr 8, 2019

@limaneto afaik this should be resolved by the bump to 1.8.2

@justinlazaro-iselect
Copy link

justinlazaro-iselect commented Sep 18, 2019

having an issue here, same error. any fix?

ApiGatewayStage:
    Type: AWS::ApiGateway::Stage
    Properties:
      RestApiId:
        Ref: ApiGatewayRestApi
      MethodSettings:
        - DataTraceEnabled: true
          HttpMethod: '*'
          LoggingLevel: INFO
          ResourcePath: '/*'
          MetricsEnabled: true

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

No branches or pull requests