Skip to content

X7 order_filled: AttributeError 'NoneType' object has no attribute 'split' — ft_order_tag unguarded (system_v3_2) #1091

Description

@Thug-angel

Summary

NostalgiaForInfinityX7.order_filled() raises AttributeError: 'NoneType' object has no attribute 'split' whenever it is called for an order whose ft_order_tag is None. The system_v3_2 branch reads order.ft_order_tag and immediately calls .split() without the if order.ft_order_tag is not None: guard that is used everywhere else in the file.

Versions

  • NFI: v17.4.281 (also reproduced on v17.4.268) — main HEAD at time of report.
  • Freqtrade: 2026.5.1 (CCXT 4.5.55, Python 3.14)
  • Mode: dry-run, spot, 5m timeframe

Traceback

freqtrade.strategy.strategy_wrapper - ERROR - Unexpected error
AttributeError("'NoneType' object has no attribute 'split'")
calling NostalgiaForInfinityX7.order_filled
Traceback (most recent call last):
  File "/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 46, in wrapper
    return f(*args, **kwargs)
  File ".../NostalgiaForInfinityX7.py", line 2699, in order_filled
    order_mode = order_tag.split(" ", 1)
AttributeError: 'NoneType' object has no attribute 'split'

Offending code (v17.4.281, order_filled, system_v3_2 branch, ~lines 2696-2703)

if system_name_use == system_v3_2_name:
    filled_entries = trade.select_filled_orders(trade.entry_side)

    order_tag = order.ft_order_tag          # can be None
    order_mode = order_tag.split(" ", 1)    # AttributeError when None
    order_tags = []
    if len(order_mode) > 0:
        order_mode = order_mode[0]
    order_tags = order_tag.split(" ")       # same problem

Why this is a bug (internal inconsistency)

Every other ft_order_tag access in the same file is guarded, e.g.:

if order.ft_order_tag is not None:
    order_tag = order.ft_order_tag.partition(" ")[0]

There are 15 such guarded sites in v17.4.281 (e.g. lines ~1171, 41808, 41888, 44315, 44386, 46751, 46766, 48812, 65511, 65591, 68084, 68146, 70087, 70102, 72066). Only the order_filled / system_v3_2 branch omits the guard.

Impact

Non-fatal — the error is caught by strategy_wrapper, so the bot keeps trading. But order_filled aborts before it records the derisk_level_* custom_data, so derisk/grind bookkeeping is skipped for that fill. On a position that is being actively ground (a long-held DCA'd trade) it fires frequently — ~15-20 ERROR tracebacks/minute observed on one bot.

Reproduction

Occurs during grind/DCA fills on a long-held position where the filled order's ft_order_tag is None. Seen continuously on a spot trade open ~3 weeks (heavy grind).

Suggested fix

Guard like the rest of the file:

order_tag = order.ft_order_tag
if order_tag is None:
    return

or simply order_tag = order.ft_order_tag or "".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions