Skip to content

Severe oxmysql Query Delays Causing svMain Hangs Across Multiple FiveM Servers (Linux & Windows) #292

Description

@Jrogers4200

Issue checklist

Please put x inside of the box that matches your issue.

  • I am using the latest release
  • I have referenced previously reported issues
  • I have referenced available documentation and cannot resolve the issue
  • I'm certain this is an issue with oxmysql, and not with my resource

Describe the bug

We are experiencing recurring severe database-related hitches and full svMain hangs across multiple FiveM servers using oxmysql.

This is currently affecting three separate servers:

  • 2 servers running Ubuntu/Linux
  • 1 server running Windows

The issue presents similarly across all three environments.

The servers will run normally for a period of time and then begin producing large server thread hitch warnings. In some cases, oxmysql queries take multiple seconds to complete immediately before or during the hitch.

Example:

[script:oxmysql] qbx_core took 2767.3559ms to execute a query!

followed immediately by:

[citizen-server-impl] server thread hitch warning: timer interval of 2763 milliseconds

We have also seen much larger server-thread hitches ranging from approximately 15 to 60+ seconds.

Eventually the server can stop responding entirely and report:

Error: Loop svMain seems hung! (last checkin 45 seconds ago)

txAdmin then stops receiving heartbeats and restarts the server.

We have also repeatedly seen:

[script:oxmysql] Warning: Failed to retrieve latest version of oxmysql (ETIMEDOUT).

and:

[citizen-server-impl] Server list query returned an error: EOF

The svMain watchdog does not consistently report the same resource. It has pointed at multiple unrelated resources across different hangs, which makes it appear that the named resource is simply where the main thread happened to be when it stalled.

Example watchdog output:

svMain watchdog stack: qbx_binoculars: event monitor:cb_... <- qbx_adminmenu: event monitor:exists <- qbx_binoculars: tick <- root

This behavior has now been observed on multiple independent servers and operating systems.

Screenshots

Screenshots are attached showing:

  • oxmysql queries taking multiple seconds
  • server thread hitch warnings occurring at the same time
  • svMain watchdog hangs
  • txAdmin heartbeat loss and automatic restarts

Code

Example query shown in the logs:

SELECT userId, citizenid, license, name, charinfo, money, job, gang, position, metadata,
UNIX_TIMESTAMP(last_logged_out) AS lastLoggedOutUnix
FROM players
WHERE citizenid = ?

<img width="1315" height="180" alt="Image" src="https://github.com/user-attachments/assets/2eed4a9c-a3b1-4559-a8ba-447faca5f84e" />

<img width="1315" height="180" alt="Image" src="https://github.com/user-attachments/assets/dea55d23-d5c9-4fd3-9020-35289bfd12b4" />

<img width="993" height="517" alt="Image" src="https://github.com/user-attachments/assets/68a6c2c0-45bf-4bd3-8473-a1a6a0521bd9" />
<img width="1097" height="507" alt="Image" src="https://github.com/user-attachments/assets/bccb6ca7-1474-4015-af8b-8c5aad47c096" />
<img width="977" height="851" alt="Image" src="https://github.com/user-attachments/assets/4b95f037-75b8-43fa-b1f1-7cdf5de6efeb" />
<img width="1456" height="94" alt="Image" src="https://github.com/user-attachments/assets/94235a98-3ab3-4b9a-8125-33219f298327" />
<img width="649" height="409" alt="Image" src="https://github.com/user-attachments/assets/f45d5ab2-a1d6-42f5-b1f7-37be203f379c" />

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions