Skip to content

Airflow Standalone Segfaulting when Ran Locally #55838

Closed

Description

@Hchanni

Apache Airflow version

Other Airflow 2 version (please specify below)

If "Other Airflow 2 version" selected, which one?

2.10.3

What happened?

Trying to run airflow standalone and it just segfaults:

webserver  | Fatal Python error: Segmentation fault
webserver  | Current thread 0x000000020a774800 (most recent call first):
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/util.py", line 53 in _setproctitle
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 607 in spawn_worker
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 645 in spawn_workers
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 572 in manage_workers
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 212 in run
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/app/base.py", line 71 in run
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/app/base.py", line 235 in run
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 66 in run
webserver  | File "source/.venv/lib/python3.11/site-packages/gunicorn/__main__.py", line 10 in <module>
webserver  | File "<frozen runpy>", line 88 in _run_code
webserver  | File "<frozen runpy>", line 198 in _run_module_as_main
webserver  | Extension modules: setproctitle._setproctitle, _brotli, zstandard.backend_c, charset_normalizer.md, simplejson._speedups, requests.packages.charset_normalizer.md, requests.packages.chardet.md, _cffi_backend, yaml._yaml, sqlalchemy.cimmutabledict, greenlet._greenlet, sqlalchemy.cprocessors, sqlalchemy.cresultproxy, tornado.speedups, pendulum.parsing._iso8601, pendulum._extensions._helpers, lazy_object_proxy.cext, markupsafe._speedups, PIL._imaging, psycopg2._psycopg, multidict._multidict, yarl._quoting_c, propcache._helpers_c, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket.mask, aiohttp._websocket.reader_c, frozenlist._frozenlist, snappy._snappy, lz4._version, lz4.frame._frame, msgpack._cmsgpack, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.tslib, pandas._libs.lib, pandas._libs.hashing, pyarrow.lib, pandas._libs.ops, pyarrow._compute, pandas._libs.arrays, pandas._libs.index, pandas._libs.join, pandas._libs.sparse, pandas._libs.reduction, pandas._libs.indexing, pandas._libs.internals, pandas._libs.writers, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.tslibs.strptime, pandas._libs.groupby, pandas._libs.testing, pandas._libs.parsers, pandas._libs.json (total: 88)
webserver  | [2025-09-18 10:01:04 -0400] [21754] [ERROR] Worker (pid:22183) was sent SIGSEGV!

What you think should happen instead?

No response

How to reproduce

Install MacOS26 and then use the airflow version and attempt airflow standalone with that apache airflow version.

Operating System

Local: MacOS 26

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Sep 18, 2025
  2. boring-cyborg commented on Sep 18, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  3. Pappol commented on Sep 23, 2025

    @Pappol

    I am having the same issue

  4. SamuelBortolinAfliant commented on Sep 23, 2025

    @SamuelBortolinAfliant

    Upvote for this, there is something broken when using it with MacOS 26. Also using Airflow v3 same issue.

  5. StefanoTavonatti commented on Sep 23, 2025

    @StefanoTavonatti

    Same problem here

  6. ericsua commented on Sep 23, 2025

    @ericsua

    I have the same issue on Airflow 3 with both scheduler and triggerer on macOS 26

    scheduler  | [2025-09-23 11:23:56 +0200] [2842] [ERROR] Worker (pid:2856) was sent SIGSEGV!
    scheduler  | [2025-09-23 11:23:56 +0200] [2842] [ERROR] Worker (pid:2857) was sent SIGSEGV!
    triggerer  | [2025-09-23 11:23:56 +0200] [2840] [ERROR] Worker (pid:2858) was sent SIGSEGV!
    

    Doing it in Docker works correctly

  7. leonellielena commented on Sep 23, 2025

    @leonellielena

    I have the same issue on airflow 3

  8. Nissooo commented on Sep 24, 2025

    @Nissooo

    Same issue, happened after upgrading to MacOS 26.

  9. sako-ranj commented on Oct 5, 2025

    @sako-ranj

    Same issue, happened after upgrading to MacOS 26.

  10. BawarX commented on Oct 5, 2025

    @BawarX

    Same issue, happened after upgrading to MacOS 26.

  11. sako-ranj commented on Oct 12, 2025

    @sako-ranj

    Fixed after upgrading to airflow 3.1.0.

  12. 3cham commented on Oct 14, 2025

    @3cham

    Is there any workaround without updating airflow to 3.x.x?

  13. potiuk commented on Oct 14, 2025

    @potiuk
    Member

    Is there any workaround without updating airflow to 3.x.x?

    You can run airflow in docker container. We are also going to release 2.11.1 soon(ish) and I will try to see if I can reproduce it there on MacOS 26. But no promises. Possibly it is caused by setproctitle so you might want to apply #53122 to your Airflow and report here if it solves your problem @3cham

  14. 5 remaining items

  15. potiuk commented on Nov 10, 2025

    @potiuk
    Member

    Nice workaround !

  16. judoole commented on Nov 12, 2025

    @judoole
    Contributor

    I managed to get around the problem by putting this in my airflow_local_settings.py. You can probably try adding it to some file that's loaded up very early in the startup. eg for me, airflow.cfg references airflow_local_settings.py so I put it there.

    I tried doing the same as you @mehernosh, but I keep having the SIGSEGV error. I see that the mock is used, because it prints the skipping message for some DAGs that are faulty. Are you able to share some more info on how it worked for you? Did you do anything else as well?

  17. ndewijer commented on Nov 13, 2025

    @ndewijer

    I build further on this. The airflow_config_settings was not being loaded fast enough so I modified the setproctitle init inside my venv with:

    site-packages/setproctitle/__init__.py

    """Allow customization of the process title."""
    
    import os
    import sys
    import logging
    
    logger = logging.getLogger("setproctitle")
    
    __version__ = "1.3.3"
    
    __all__ = [
        "setproctitle",
        "getproctitle",
        "setthreadtitle",
        "getthreadtitle",
    ]
    
    
    def setproctitle(title: str) -> None:
        logger.debug("setproctitle C module not available")
        return None
    
    
    def getproctitle() -> str:
        logger.debug("setproctitle C module not available")
        return " ".join(sys.argv)
    
    
    def setthreadtitle(title: str) -> None:
        logger.debug("setproctitle C module not available")
        return None
    
    
    def getthreadtitle() -> str:
        logger.debug("setproctitle C module not available")
        return ""
    
    
    # PATCHED: Skip C module import on macOS to avoid SIGSEGV crashes
    # The fallback Python implementations above will be used instead
    if sys.platform != "darwin":
        try:
            from . import _setproctitle  # type: ignore
        except ImportError as e:
            # Emulate SPT_DEBUG showing process info in the C module.
            if os.environ.get("SPT_DEBUG", ""):
                logging.basicConfig()
                logger.setLevel(logging.DEBUG)
            logger.debug("failed to import setproctitle: %s", e)
        else:
            setproctitle = _setproctitle.setproctitle 
            getproctitle = _setproctitle.getproctitle
            setthreadtitle = _setproctitle.setthreadtitle
            getthreadtitle = _setproctitle.getthreadtitle
    else:
        logger.debug("Using Python fallback for setproctitle on macOS to avoid SIGSEGV")
    

    Definitely not clean and can get overwritten easily, but at least I can continue with my work.

  18. mehernosh commented on Nov 13, 2025

    @mehernosh

    hey @judoole, I realised I just always default to using the airflow webserver -d option to start airflow in debug mode with LocalExecutor.
    I acknowledge that my solution does not work without -d

    @ndewijer 👍 glad you were able to build on it.

  19. bjoernpollex-sc commented on Nov 21, 2025

    @bjoernpollex-sc

    Unfortunately the workaround presented by @ndewijer doesn't work for me. The SIGSEGV goes away, but now when I run airflow standalone I keep getting this message in the log:

    webserver  | [2025-11-21T12:19:26.919+0100] {webserver_command.py:237} DEBUG - [0 / 4] Some workers are starting up, waiting...
    
  20. PhilippeMoussalli commented on Nov 24, 2025

    @PhilippeMoussalli

    workaround does not work for me as well, any updated on this issue?

  21. jeffreylipnick commented on Dec 17, 2025

    @jeffreylipnick

    The workaround from @ndewijer in #55838 (comment) worked for me. Thank you 🙇

  22. kazibo commented on Jan 5, 2026

    @kazibo

    On my machine @ndewijer 's solution works if i run webserver in debug mode. Airflow 2.9.3

  23. gthomas-strike commented on Feb 12, 2026

    @gthomas-strike

    I spent an hour or so with Claude Code getting to the bottom of this issue, and this is what we came up with. I switched to using py-setproctitle building from this branch and it completely resolved the issues for me.

    gthomas-strike/py-setproctitle#1

    The code is 100% AI generated. If anyone more familiar with Python C extensions wants to review and take it from here, feel free to do so. The PR is currently only opened against my forked repo.

  24. judoole commented on Mar 27, 2026

    @judoole
    Contributor

    Thanks a lot @gthomas-strike. Now working for our local setup, using requirements, referencing your code, like this

    setproctitle @ git+https://github.com/gthomas-strike/py-setproctitle.git@6b4378838a98cab15eb953e42fffdabc80ca8793
    

    Had to ensure that we run with webserver -d as well.

  25. ann8ty commented on May 4, 2026

    @ann8ty

    Can reproduce the issue with Airflow 2.11.2 on Mac OS 26.4.1.

  26. potiuk commented on May 5, 2026

    @potiuk
    Member

    There are no more releases of 2.11 - it reached EOL. Closing the issue. Similar issue on Mac has been recently fixed in latest Airflow 3 - i recommend migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    _eol_affected_version:2.10area:corekind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions