Skip to content

Get json decode error when running scheduler after downgrade to 2.10.5 from 3.0 #49574

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
1 task done
dstandish opened this issue Apr 22, 2025 · 2 comments
Closed
1 task done
Labels
affected_version:3.0 Issues Reported for 3.0 area:core area:upgrade Facilitating migration to a newer version of Airflow kind:bug This is a clearly a bug kind:meta High-level information important to the community priority:high High priority bug that should be patched quickly but does not require immediate new release

Comments

@dstandish
Copy link
Contributor

dstandish commented Apr 22, 2025

It chokes when reading dag model

[2025-04-22T10:44:02.597-0700] {dag.py:3239} INFO - Sync 1 DAGs
Traceback (most recent call last):
  File "/Users/dstandish/code/airflow-old/.venv/bin/airflow", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/__main__.py", line 62, in main
    args.func(args)
  File "/Users/dstandish/code/airflow-old/airflow/cli/cli_config.py", line 49, in command
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/utils/cli.py", line 116, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/utils/providers_configuration_loader.py", line 55, in wrapped_function
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/utils/session.py", line 97, in wrapper
    return func(*args, session=session, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/cli/commands/dag_command.py", line 661, in dag_reserialize
    dagbag.sync_to_db(session=session)
  File "/Users/dstandish/code/airflow-old/airflow/utils/session.py", line 94, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/models/dagbag.py", line 736, in sync_to_db
    import_errors = DagBag._sync_to_db(dags=self.dags, processor_subdir=processor_subdir, session=session)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/utils/session.py", line 94, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/models/dagbag.py", line 708, in _sync_to_db
    for attempt in run_with_db_retries(logger=log):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 445, in __iter__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/dstandish/code/airflow-old/airflow/models/dagbag.py", line 724, in _sync_to_db
    DAG.bulk_write_to_db(dags.values(), processor_subdir=processor_subdir, session=session)
  File "/Users/dstandish/code/airflow-old/airflow/utils/session.py", line 94, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/models/dag.py", line 3252, in bulk_write_to_db
    orm_dags: list[DagModel] = session.scalars(query).unique().all()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 1476, in all
    return self._allrows()
           ^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 401, in _allrows
    rows = self._fetchall_impl()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 1389, in _fetchall_impl
    return self._real_result._fetchall_impl()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 1813, in _fetchall_impl
    return list(self.iterator)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/orm/loading.py", line 147, in chunks
    fetch = cursor._raw_all_rows()
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 393, in _raw_all_rows
    return [make_row(row) for row in rows]
            ^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/.venv/lib/python3.12/site-packages/sqlalchemy/sql/type_api.py", line 1723, in process
    return process_value(value, dialect)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/code/airflow-old/airflow/utils/sqlalchemy.py", line 335, in process_result_value
    data = json.loads(value)
           ^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstandish/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/json/decoder.py", line 341, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 3 (char 2)

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@dstandish dstandish added affected_version:3.0 Issues Reported for 3.0 kind:bug This is a clearly a bug kind:meta High-level information important to the community priority:high High priority bug that should be patched quickly but does not require immediate new release labels Apr 22, 2025
@dosubot dosubot bot added area:core area:upgrade Facilitating migration to a newer version of Airflow labels Apr 22, 2025
@dstandish
Copy link
Contributor Author

Looks like we need to set schedule_interval to be null when downgrading because previously it was json but now it is plain string.

@uranusjr
Copy link
Member

#49583 fixes this, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:3.0 Issues Reported for 3.0 area:core area:upgrade Facilitating migration to a newer version of Airflow kind:bug This is a clearly a bug kind:meta High-level information important to the community priority:high High priority bug that should be patched quickly but does not require immediate new release
Projects
None yet
Development

No branches or pull requests

2 participants