Skip to content

Warn log messages are being displayed as errors #1580

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

Closed
lox opened this issue Jun 28, 2024 · 5 comments
Closed

Warn log messages are being displayed as errors #1580

lox opened this issue Jun 28, 2024 · 5 comments

Comments

@lox
Copy link

lox commented Jun 28, 2024

[REQUIRED] Version info

firebase-admin 12.1.1
firebase-functions 5.0.1
node v20.5.1

[REQUIRED] Test case

It appears that in the past 48 hours warnings from firebase-functions/logger have been showing up as errors.

Deploy this http function and load it:

import { onRequest } from 'firebase-functions/v2/https'
import {
  info,
  debug,
  warn,
  error,
} from 'firebase-functions/logger'

export const testLogging = onRequest(
  {
    region: 'australia-southeast1',
  },
  async (req, res) => {
    debug('Testing debug log level')
    info('Testing info log level')
    warn('Testing warn log level')
    error('Testing error log level')

    res.status(200).send('🪵')
  }
)

Then view Google Logs Explorer and look for the warn log level message:

{
  "textPayload": "Testing warn log level",
  "insertId": "667e7fed000a90ce8ae6c9ec",
  "resource": {
    "type": "cloud_run_revision",
    "labels": {
      "revision_name": "http-testlogging-00002-qah",
      "service_name": "http-testlogging",
      "project_id": "xxx",
      "configuration_name": "http-testlogging",
      "location": "australia-southeast1"
    }
  },
  "timestamp": "2024-06-28T09:18:37.692430Z",
  "severity": "ERROR",
  "labels": {
    "instanceId": "005b708770fa60bf66093c20c8214ea75b9da59219f1c76cbfbe177450f989958c2946acb605b23f136dac9d40cb24066e36d8c9a79947567ef13ee51241fc081cf5",
    "goog-managed-by": "cloudfunctions",
    "execution_id": "yhdyeteoez7x"
  },
  "logName": "projects/xxx/logs/run.googleapis.com%2Fstderr",
  "trace": "0f01589a5a42a5fe40154bd92d849074",
  "receiveTimestamp": "2024-06-28T09:18:37.694508458Z",
  "spanId": "1624219371595579013"
}

Note the incorrect "severity": "ERROR",

[REQUIRED] Steps to reproduce

Follow the test case.

[REQUIRED] Expected behavior

Warn should present as severity: WARNING

[REQUIRED] Actual behavior

Warn is "severity": "ERROR",

Were you able to successfully deploy your functions?

Yup.

@exaby73 exaby73 self-assigned this Jul 1, 2024
@lox
Copy link
Author

lox commented Jul 7, 2024

I have narrowed this down in a new project to introducing the following package.json dependency:

"@google-cloud/functions-framework": "^3.4.0"

See patientnotes/gcp-case-52054407@574dfe5

@jrmfg
Copy link

jrmfg commented Jul 9, 2024

Fixed in functions-framework-nodejs from 3.4.1 onwards

GoogleCloudPlatform/functions-framework-nodejs#620

@exaby73
Copy link
Contributor

exaby73 commented Jul 15, 2024

@lox Can you confirm if 3.4.1 fixes your issue?

@exaby73 exaby73 added the Needs: Author Feedback Issues awaiting author feedback label Jul 15, 2024
@google-oss-bot
Copy link
Collaborator

Hey @lox. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Collaborator

Since there haven't been any recent updates here, I am going to close this issue.

@lox if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

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

4 participants