Attempt to write logs with no transports
See original GitHub issueThis seems to be the issue reported as part of #381 however is not caused by the same problem and a serious problem that I have to put in monitoring to kill my services when I see these log messages.
This is occurring in GKE and only occurs after the service is running for a period of time.
I’m running @google-cloud/logging
version 5.2.0 and google-gax
1.1.5.
The log I’m posting below came from a service that started a 6pm PST then at around 20 minutes past midnight, I get one log message:
"(node:34) UnhandledPromiseRejectionWarning: Error:
at Http2CallStream.call.on (/tsg/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/client.js:96:45)
at Http2CallStream.emit (events.js:203:15)
at process.nextTick (/tsg/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/call-stream.js:71:22)
at process._tickCallback (internal/process/next_tick.js:61:11)
"
Then
[winston] Attempt to write logs with no transports {"warning":{"name":"UnhandledPromiseRejectionWarning"},"level":"warn","message":"Error: \n at Http2CallStream.call.on (/tsg/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/client.js:96:45)\n at Http2CallStream.emit (events.js:203:15)\n at process.nextTick (/tsg/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/call-stream.js:71:22)\n at process._tickCallback (internal/process/next_tick.js:61:11)"}
then I just get repeated messages about writing logs with no transports for a while then it just goes completely silent
Issue Analytics
- State:
- Created 4 years ago
- Comments:29 (13 by maintainers)
Top Results From Across the Web
Attempt to write logs with no transports - using default logger ...
In winston 3 you need to create a logger object, then add transport s to it. Winston 3 has many examples, but to...
Read more >Attempt to write logs with no transports. · Issue #1645 - GitHub
Pre-ESM, I had a logging module with a function that created the logger, and another function for retrieving the logger (getLogger() ). Every ......
Read more >How To Log Like A Boss With Node.js | by Eren Yatkin
[winston] Attempt to write logs with no transports {"message":"Test Log","level":"info"}. Because we have not configured it.
Read more >Attempt to write logs with no transports – using default logger ...
Best Solution. In winston 3 you need to create a logger object, then add transport s to it.
Read more >A Complete Guide to Winston Logging in Node.js - Better Stack
Learn how to start logging with Winston in Node.js and go from basics to best ... Here are some custom transports that you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a repro. Looking into it…
With this, after I get an expected unhandled rejection for a huge log message, I start getting Winston’s messages about having no transport:
Some preliminary thoughts:
I suspect the long message is still coming from your code, or maybe somehow from Winston. We do have request bundling, but the bundling does not group log messages into one entry, and the error says that an entry size exceeds the limit.
I could not reproduce any problem using
@google-cloud/logging
directly without Winston. TheAttempt to write logs with no transports
error comes from Winston. Unclear yet if it’s Winston fault or our layer (@google-cloud/logging-winston
). I’m looking into this now.Please hold on…
The problem with logging to stdout is errors. Because stdout considers each line a different log message, you can never actually read an error with more than one line nor does it get properly handled by StackDriver Errors. You also lose the ability to change logging levels and formats dynamically.
If you just update to the latest version of Winston it has my fix in it (i.e. version 3.3.3 or higher).
If you don’t want to upgrade, the actual solution to this problem for most is to just add the following snippet:
where “log” is the winston log instance and “winstonTransport” is a reference to an instance of the LoggingWinston class from @google-cloud/logging-winston