Troubleshooting

Common issues and fixes for Oxide Vending.

Common problems with oxide-vending and how to fix them. When something goes wrong, check two places: the server console (the window your server runs in) and the F8 console in-game (press F8).

Database problems

Errors mentioning vending_ tables

If the server console shows errors about missing vending_businesses, vending_machines, or similar tables, the database setup step was skipped or didn't finish.

To check whether the tables exist, run this in your database tool (HeidiSQL, phpMyAdmin, etc.):

SHOW TABLES LIKE 'vending_%';

You should see 13 tables. If you don't, run the file sql/install.sql against your database (it's safe to run again).

"WARNING: Could not load progression data" on startup

The exact message is:

[oxide-vending] WARNING: Could not load progression data. Have you run sql/install.sql?

It means the vending_progression and vending_milestones tables are missing. Run sql/install.sql as above.

Startup problems

The resource won't start

First make sure your server.cfg starts things in this order:

ensure ox_lib
ensure oxmysql
ensure o-link
ensure oxide-vending

Then check:

  • you didn't accidentally change or delete fxmanifest.lua
  • if you edited any config file, the edit didn't break it — a missing comma or quote will stop the whole resource from loading, and the server console will show a red error with the file name and line number

Errors saying "attempt to index a nil value"

This almost always means o-link isn't doing its job. Common causes:

  • o-link isn't started, or starts after oxide-vending
  • o-link isn't set up for your framework, so it can't find your inventory, money, or targeting systems
  • players aren't being marked as "loaded" by your framework, so the resource never hears about them

Check the o-link documentation for your framework setup.

Money and balance problems

Registration works, but deposits or withdrawals fail

The business keeps its own balance, and deposits/withdrawals move money to and from the player's personal bank account.

Work through these:

  1. Run /vendingdebug bank <businessId> (or in-game with no ID to use your own business) to see what the server thinks the balance is.
  2. Compare against the database:
    SELECT business_id, balance FROM vending_businesses WHERE business_id = 'your-id';
  3. For deposits: does the player actually have that much in their bank account?
  4. Does the player have the deposit or withdraw permission? Only owners can withdraw by default.

Revenue seems to be missing

Money from sales sits in two places: each machine holds its own takings until collected, and collected money goes to the business balance. Check the machine first — the owner may simply not have collected yet.

If the database rows look right but the dashboard shows stale numbers, restart the resource — the dashboard reads from the server's memory, which is rebuilt on start.

Machine problems

The placement preview doesn't appear

  1. The player can't place from inside a vehicle — get out first.
  2. Check the machine type still exists in config/machines.lua.
  3. If you changed a machine's prop model, make sure the model name is a real GTA prop — a typo here makes the preview silently fail.
  4. Set Config.Debug = true and try again; the F8 console will say what's wrong.

"This location is not suitable" / placement keeps being refused

A spot is refused when:

  • the business is at its machine limit for its level
  • the machine type isn't unlocked yet
  • the spot is inside a Config.BlockedZones area
  • it's too close to another machine (MinDistanceBetweenMachines)
  • it's too far from the player (MaxDistanceFromPlayer)

Players can't interact with a machine

  1. Make sure a targeting resource (like ox_target) is running — interactions go through it via o-link.
  2. Check the machine isn't broken or inactive — broken machines need a repair first.
  3. Try standing closer (Config.Interaction.TargetDistance is 2.5 meters by default).
  4. Another resource's interaction zone may be sitting on top of the machine and swallowing the click.

Warehouse and pickup problems

The warehouse code doesn't work

  1. Confirm the business actually owns a warehouse:
    SELECT * FROM vending_warehouses WHERE business_id = 'your-id';
  2. The code must be exactly the configured length (4 digits by default).
  3. After 5 wrong attempts, the player is locked out for 5 minutes — "Too many failed attempts. Try again in 5 minutes." means wait, not that the code is wrong.

A player is stuck "inside" the warehouse / can't see anyone

Warehouses put players in their own private instance. If someone gets stuck there:

  • have them reconnect — that's usually enough
  • if it keeps happening, an admin can check the player's routing bucket on the server and move them back to bucket 0

Warehouse storage looks wrong

Check what the database has:

SELECT * FROM vending_business_inventory WHERE business_id = 'your-id';

Then confirm:

  • the stored item names still exist in your inventory system (if you renamed or removed an item, stored copies of it become unusable)
  • the warehouse isn't simply full — MaxCapacity (total items) or MaxItemTypes (different items) may be blocking new deposits
  • there are no database errors in the server console when depositing or withdrawing

Wholesale boxes never appear on the pallet

  1. Check Config.PickupLocation.Enabled = true.
  2. Check whether the order made it to the database:
    SELECT * FROM vending_pickup_boxes;
  3. Remember deliveries take time — 5 minutes by default (Config.Wholesale.DeliveryTime).
  4. If you moved the pallet or changed the prop models, double-check the coordinates and model names.
  5. Run /vendingdebug boxes 4 in-game to spawn test boxes — if those appear, the visual side is fine and the problem is with the orders.

NPC sales problems

Machines never sell anything on their own

  1. Check Config.NPCSales.Enabled = true (or run /vendingnpc toggle).
  2. Run /vendingnpc stats — it shows whether the system is running and how many sales it has made.
  3. Run /vendingnpc force to trigger a high-chance test round.
  4. The machine must be active (not broken or switched off) and have stock. With AvoidLastItem on, a machine with only 1 of an item won't sell it.

NPC sales feel too slow

That may be by design. Sales depend on machine type, location, time of day, pricing, stock variety, and nearby competition — an overpriced electronics machine in the countryside will barely sell. To speed everything up globally, raise BaseChancePerTick or RevenueMultiplier in config/npc_sales.lua. See NPC Sales for how each factor works.

The time of day seems wrong

If oxide-weather is installed and running, NPC sales follow the in-game clock. Without it, they follow real-world server time — so your players may see "lunch rush" sales at real-world noon rather than in-game noon. Both are normal; install oxide-weather if you want in-game time.

Level problems

A business isn't leveling up

Leveling needs both enough XP and enough lifetime revenue. A business can be far past the XP requirement and still stay put because it hasn't earned enough money — check both numbers on the dashboard's progression panel.

A business has no level data at all

This can happen to businesses created before the progression tables existed. Run:

/vendingdebug progression status
/vendingdebug progression init

status reports who's missing data; init fixes everyone at once. To fix a single business: /vendingdebug progression create <businessId>.

The daily bonus resets at a strange time

The daily bonus day rolls over at midnight UTC, not your local midnight. Depending on your timezone this can feel a few hours early or late — that's expected. To inspect what the server has saved, run /vendingdebug daily <businessId> and read the output in the server console.

Dashboard problems

/vdb opens nothing

  1. Only business owners and employees can open the dashboard — a player with no business gets nothing.
  2. Press F8 and look for red errors mentioning NUI or oxide-vending.
  3. Make sure the html/ folder is intact — if files were deleted or half-overwritten during an update, the screen can't load.
  4. Check the server console for callback errors when the player runs the command.

The dashboard opens but data is missing or broken

  • check the server console for errors at the moment the dashboard loads
  • confirm the database connection is healthy (other oxmysql resources working?)
  • if the map tab is blank, confirm the tile images still exist under html/img/map-tiles/

Performance

Server-side

If the resource shows up in your server profiler:

  • raise Config.NPCSales.TickInterval so the simulation runs less often
  • lower Config.Transactions.RetentionDays and keep PruneOnStartup = true so the transactions table stays small
  • very dense clusters of machines make the competition checks work harder — encourage spreading out

Client FPS drops near machines

  • many machine props packed into one spot is the usual cause
  • the NPC visual feedback animates nearby pedestrians; turn Config.NPCSales.VisualFeedback.Enabled off if it bothers low-end players

Messages players might report

These are the exact texts players see, and what they mean:

MessageMeaning
"This machine type is locked until Level X"The business hasn't unlocked that machine type yet
"You have reached the maximum number of machines"The business is at its machine limit for its level
"The server has reached the maximum number of vending businesses"Your Config.Business.MaxBusinesses cap has been hit
"This item cannot be sold in this machine"The item isn't on that machine type's whitelist in config/items.lua
"Price must be between $X and $Y"The owner tried to set a price outside their level's allowed range
"Please wait before doing that again" / "Too many actions, please slow down"The anti-spam limiter kicked in. Normal play shouldn't trigger it — if it does, the limits in server/main.lua can be relaxed
"Too many failed attempts. Try again in 5 minutes."5 wrong warehouse codes in a row — the lockout clears on its own

Debug mode

Config.Debug = true

Turns on detailed logging for loading, placement, machine sync, leveling, NPC sales, and the warehouse and pickup systems. Use it while diagnosing, then turn it back off — it's noisy.

Next Steps