question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on logging empty line to Cloudwatch

See original GitHub issue

Apache Airflow version: 2.0.1

Environment:

  • Cloud provider or hardware configuration: AWS

What happened: I have Airflow with Cloudwatch-based remote logging running. I also have BashOperator that does, for example, rsync with invalid parameters, for example rsync -av test test. The output of the rsync error is formatted and contains empty line. Once that empty line is logged to the Cloudwatch, i receive an error:

2021-04-06 19:29:22,318] /home/airflow/.local/lib/python3.6/site-packages/watchtower/__init__.py:154 WatchtowerWarning: Failed to deliver logs: Parameter validation failed:
Invalid length for parameter logEvents[5].message, value: 0, valid range: 1-inf
[2021-04-06 19:29:22,320] /home/airflow/.local/lib/python3.6/site-packages/watchtower/__init__.py:158 WatchtowerWarning: Failed to deliver logs: None

So basically empty lines can’t be submitted to the Cloudwatch and as result the whole output of the process doesn’t appear in logs.

What you expected to happen:

I expect to have an output of the bash command in logs. Empty lines can be skipped or replaced with something.

How to reproduce it:

For example: run BashOperator with rsync command that fails on Airflow with Cloudwatch-based remote logging. It could be any other command that produces empty line in the output.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
o-nikolascommented, Nov 18, 2021

I cut an issue to the watchtower repo (since the other was closed) with some possible fixes I had tested. But it seems like there is already a fix that just got released into Watchtower 2.0.

I have yet to do some testing with the new release, but once I get around to (and assuming it works as expected) it should be an easy fix to bump the watchtower version in Airflow to 2.0.

I’m happy to be assigned this issue if no one else is working on it.

1reaction
sicarulcommented, Jun 24, 2021

I just saw that a new version of apache-airflow-providers-amazon was released (2.0.0) with an updated watchtower, i’ll test it later 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot pushing log data to CloudWatch - Amazon AWS
If the awslogs.log log file takes up too much disk space, check the log file for errors, and then correct them. If the...
Read more >
[GitHub] [airflow] codenamestif opened a new issue #15279
... I have Airflow with Cloudwatch-based remote logging running. ... Once that empty line is logged to the Cloudwatch, i receive an error: ......
Read more >
New line problem in CloudWatch output when logging with ...
One solution to this is to setup the logging pattern in the logging configuration as follows: <?xml version="1.0" encoding="UTF-8"?> ...
Read more >
Creating a Cloudwatch Dashboard to Monitor Distributed ...
This widget shows you the log entry any time that it contains “Error”. Ideally, this widget will remain empty. If it is logging...
Read more >
Amazon CloudWatch Logs logging driver
Log driver returns an error by default if the log group does not exist. However, you can set the awslogs-create-group to true to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found