Skip to content

get_encrypted_app_ticket often returns None #15

@cmsautter

Description

@cmsautter

get_encrypted_app_ticket often returns None

I have librematch-steam_auth running continuously (24/7), and I’ve observed that Steam’s get_encrypted_app_ticket frequently returns None - specifically, this happens every 45 minutes.

Interestingly, this aligns exactly with the interval at which librematch-steam_auth attempts to refresh the app_ticket. This suggests that the script may be entering an invalid or inconsistent state during the refresh cycle, causing get_encrypted_app_ticket to fail.

When None is returned, an exception is thrown, which interrupts the flow unnecessarily. It would be preferable if this case were handled more gracefully, as it appears to be a recurring scenario rather than a rare exception.

Moreover, it would be helpful to investigate the root cause of why get_encrypted_app_ticket fails during these refreshes.


Unhandled None return from get_encrypted_app_ticket

The issue seems to originate from the following line in __init__.py:

if self.steam is not None:
    self.app_ticket = AppTicket(
        base64.standard_b64encode(
            self.steam.get_encrypted_app_ticket(
                APPID[0], userdata=b"RLINK"
            ).encrypted_app_ticket.SerializeToString(deterministic=True)
        ).decode()
    )

The call to get_encrypted_app_ticket(...) can return None, but this is not handled here. As a result, the code attempts to access .encrypted_app_ticket on None, leading to an exception.

Since this failure appears to happen reliably every 45 minutes (likely during a refresh cycle), it would be beneficial to:

  1. Guard against None before dereferencing the result.

  2. Optionally add a retry mechanism or backoff if this is a temporary issue with Steam’s API.

  3. Consider logging the event with more context to help diagnose why the ticket retrieval fails at that specific time.

This change would improve fault tolerance and reduce avoidable interruptions during expected runtime behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions