aws-lambda-blog icon indicating copy to clipboard operation
aws-lambda-blog copied to clipboard

api_gateway_stage_variables with empty strings causing issues

Open Gribbs opened this issue 8 years ago • 2 comments

I kept getting this error using the advanced installation:

message: 'Invalid stage variable value: .  Please use values with alphanumeric characters and the symbols \' \', -\', \'.\', \'_\', \':\', \'/\', \'?\', \'&\', \'=\', and \',\'.',
  code: 'BadRequestException',
  time: 2017-08-10T12:59:30.925Z,
  requestId: 'bf0b47af-7dcb-11e7-afed-37ac09409c8f',
  statusCode: 400,
  retryable: false,
  retryDelay: 3.199291741620147 } 'BadRequestException: Invalid stage variable value: .  Please use values with alphanumeric characters and the symbols \' \', -\', \'.\', \'_\', \':\', \'/\', \'?\', \'&\', \'=\', and \',\'.\

I ended up modifying the code to log the params and they looked like this:

params sent:  { restApiId: 'egb8hs6ese',
  stageName: 'prod',
  cacheClusterEnabled: false,
  variables: 
   { site_base_url: 'https://mydomain.com.au',
     recaptcha_siteKey: 'foo',
     recaptcha_privKey: 'bar',
     contact_send_email: '[email protected]',
     disqus_subdomain: 'my_disqus_subdomain',
     template: 'default',
     articles_bucket_path: 'static/articles',
     objects_table: 'aws-lambda-blog_objects',
     posts_table: 'aws-lambda-blog_posts',
     articles_bucket: 'XXXX-aws-lambda-blog',
     admin_pass: '',
     token_name: 'token',
     signing_key: 'bXXXXG' } }

For whatever reason the admin_pass variable was empty and this seemed to be causing the issue. When I changed it to: "admin_pass": "temporary" on line 41 of my install_config.js the problem went away. I'm thinking it might be better to initialize these to some value rather than an empty string?

Gribbs avatar Aug 10 '17 13:08 Gribbs

I ran into this same issue, and the "temporary" fix enabled the installation to proceed to completion.

ECHO-ECHOOooo avatar Sep 11 '17 20:09 ECHO-ECHOOooo

I ran into this same issue.

freethreat avatar Mar 20 '20 07:03 freethreat