Skip to content

Conversation

@kaxil
Copy link
Member

@kaxil kaxil commented Mar 9, 2021

Without this, Webserver fails with the following error. It happens because of

# Ensure a string here. Large offset numbers will get JSON.parsed incorrectly
# on the client. Sending as a string prevents this issue.
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
metadata['offset'] = str(next_offset)
:

[2021-03-09 18:55:19,640] {base.py:122} INFO - POST http://aa.aa:9200/_count [status:200 request:0.142s]
[2021-03-09 18:55:19 +0000] [64] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 181, in handle_request
    for item in respiter:
  File "/usr/local/lib/python3.7/site-packages/werkzeug/wsgi.py", line 506, in __next__
    return self._next()
  File "/usr/local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 45, in _iter_encoded
    for item in iterable:
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/log/log_reader.py", line 84, in read_log_stream
    logs, metadata = self.read_log_chunks(ti, current_try_number, metadata)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/log/log_reader.py", line 58, in read_log_chunks
    logs, metadatas = self.log_handler.read(ti, try_number, metadata=metadata)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/log/file_task_handler.py", line 217, in read
    log, metadata = self._read(task_instance, try_number_element, metadata)
  File "/usr/local/lib/python3.7/site-packages/airflow/providers/elasticsearch/log/es_task_handler.py", line 186, in _read
    and offset >= metadata['max_offset']
TypeError: '>=' not supported between instances of 'str' and 'int'

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@kaxil kaxil requested a review from ashb March 9, 2021 19:26
Without this, Webserver fails with:

```
[2021-03-09 18:55:19,640] {base.py:122} INFO - POST http://aa.aa:9200/_count [status:200 request:0.142s]
[2021-03-09 18:55:19 +0000] [64] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 181, in handle_request
    for item in respiter:
  File "/usr/local/lib/python3.7/site-packages/werkzeug/wsgi.py", line 506, in __next__
    return self._next()
  File "/usr/local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 45, in _iter_encoded
    for item in iterable:
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/log/log_reader.py", line 84, in read_log_stream
    logs, metadata = self.read_log_chunks(ti, current_try_number, metadata)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/log/log_reader.py", line 58, in read_log_chunks
    logs, metadatas = self.log_handler.read(ti, try_number, metadata=metadata)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/log/file_task_handler.py", line 217, in read
    log, metadata = self._read(task_instance, try_number_element, metadata)
  File "/usr/local/lib/python3.7/site-packages/airflow/providers/elasticsearch/log/es_task_handler.py", line 186, in _read
    and offset >= metadata['max_offset']
TypeError: '>=' not supported between instances of 'str' and 'int'
```
@kaxil kaxil merged commit 923bde2 into apache:master Mar 9, 2021
@kaxil kaxil deleted the fix-es-provider branch March 9, 2021 20:39
kaxil added a commit to astronomer/airflow that referenced this pull request Mar 13, 2021
apache#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.
kaxil added a commit that referenced this pull request Mar 13, 2021
#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 17, 2021
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 23, 2021
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Nov 27, 2021
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Mar 10, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jun 4, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jul 9, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Aug 27, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 4, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 7, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Dec 7, 2022
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jan 27, 2023
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this pull request Sep 12, 2024
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this pull request Sep 12, 2024
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 17, 2024
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Nov 7, 2024
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 1, 2025
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 22, 2025
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 17, 2025
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 15, 2025
apache/airflow#14686 fixes an issues with ES logging that should be released asap. Since we just released the providers it makes sense to release this separately.

GitOrigin-RevId: 662cb8c6ac8becb26ff405f8b21acfccdd8de2ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants