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

newrelic-lambda integrations update fails to update pre-0.9 stack due to No newrelic-log-ingestion function in region ... error JIRA #278

Closed
chaudharysaket opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chaudharysaket
Copy link
Contributor

Description

Testing if JIRA integration is working
#267

Steps to Reproduce

Create a stack with the "old" function name, i.e. using a CLI version 0.8.0 or earlier
Attempt to update it with newrelic-lambda integrations update ... using CLI version 0.9.0

Expected Behaviour

The update should succeed, either renaming the function or preserving it with the old name.

It looks like #254 may have introduced some if statements that aren't working as intended given its stated goal of preserving compatibility.

newrelic-lambda-cli/newrelic_lambda_cli/integrations.py

Lines 89 to 103 in f472e28

def get_unique_newrelic_log_ingestion_name(session, stackname=None):
if not stackname:
stackname = INGEST_STACK_NAME
stack_id = _get_cf_stack_id(session, stack_name=stackname)
if stack_id:
return "newrelic-log-ingestion-%s" % (stack_id.split("/")[2].split("-")[4])

def get_newrelic_log_ingestion_function(session, stackname=None):
unique_log_ingestion_name = get_unique_newrelic_log_ingestion_name(
session, stackname
)
if unique_log_ingestion_name:
function = get_function(session, unique_log_ingestion_name)
return function
In addition, it would be nice if the logs were more specific about which function doesn't exist. I would've identified the problem with far less effort if the error printed out No newrelic-log-ingestion-0aa... function in region, given we do have function called newrelic-log-ingestion as literally appears in the error message.
NOTE: # ( Tell us what you expected to happen. )

Relevant Logs / Console output

Your Environment

  • ex: Browser name and version:
  • ex: Operating System and version:

Additional context

@chaudharysaket chaudharysaket added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant