serverless / serverless/serverless

logStreamNames failed to satisfy contraint

Open
#4,850 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cat/deployment
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

This is a Bug Report

Description

For bug reports:

  • What went wrong?
    Logs not showing up for function when running sls logs -f graphql.

  • What did you expect should have happened?
    Logs should have showed up as normal.

  • What was the config you used?
    Relevant serverless.yaml

  • What stacktrace or error message from your provider did you see?

  Serverless Error ---------------------------------------
 
  1 validation error detected: Value '[]' at 'logStreamNames' failed to satisfy constraint: Member must have length greater than or equal to 1

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
  • If there is additional config how would it look

Similar or dependent issues:

  • #12345

Additional Data

The issue may be due to the nature of the log stream naming by CloudWatch. For example the current log stream was auto named date[24]random instead of the normal date[$LATEST]random. I am not sure why CloudWatch does this (the number in brackets seems to increment by one with re-deploys?).

  • Serverless Framework Version you're using:
    1.26.1
  • Operating System:
    Ubuntu 16.04
  • Stack Trace:
  • Provider Error messages:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing sls logs -f graphql with the linked serverless.yml configuration and inspect the reported logStreamNames validation error. Compare the deployed CloudWatch log-stream naming with the command's lookup assumptions; done means the command returns the function's logs without the empty-list constraint error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.