# Troubleshooting

### Before You Begin

Before troubleshooting, ensure you have the following information ready:

* Server console error messages
* Client console error messages
* Steps to reproduce the issue
* Server configuration details
* Resource loading order

**💡 Pro Tip:** Enable debug mode in `config.lua` by setting `Config.Debug = true` to get detailed logging information for troubleshooting.

### 🚨 Common Issues

Here are the most common issues players and administrators encounter with Sergei's Warehouse:

### ❌ "You do not have access to any warehouse"

**Error:** This message appears when trying to access warehouse storage or enter a warehouse.

#### Possible Causes

* Player doesn't own a warehouse
* Player doesn't have shared access to any warehouses
* Database connection issues
* Resource not properly loaded

#### Solutions

1. **Check Warehouse Ownership:** Ensure the player has purchased a warehouse
2. **Verify Shared Access:** Check if the player has been granted shared access
3. **Database Check:** Verify database connection and table creation
4. **Resource Restart:** Try restarting the warehouse resource

\-- Check if player has warehouse in database SELECT \* FROM warehouses WHERE owner\_citizenid = 'player\_citizenid'; -- Check if player has shared access SELECT \* FROM warehouse\_sharing WHERE shared\_with\_citizenid = 'player\_citizenid';

### ❌ "This storage crate is not available"

**Error:** This message appears when trying to access a storage crate.

#### Possible Causes

* Storage slot not purchased
* Invalid crate index
* Database synchronization issues

#### Solutions

1. **Purchase Storage Slots:** Buy additional storage slots to access more crates
2. **Check Slot Count:** Verify the number of purchased slots in the database
3. **Refresh Interface:** Close and reopen the warehouse interface

\-- Check purchased slots for player SELECT purchased\_slots FROM warehouses WHERE owner\_citizenid = 'player\_citizenid';

### ❌ UI not opening with Target

**Error:** Using doesn't open the warehouse interface.

#### Possible Causes

* Resource not started
* QBCore not loaded
* Key binding conflicts
* Client-side script errors
* Check SQL has ran successfully

#### Solutions

1. **Check Resource Status:** Verify the resource is started in server console
2. **QBCore Check:** Ensure QBCore is properly loaded and running
3. **Console Errors:** Check client console for JavaScript or Lua errors
4. **Resource Restart:** Try restarting the warehouse resource

\-- Check resource status restart sergeis-warehouse -- Check for errors in console -- Look for any red error messages in client console

### ❌ Cannot enter warehouse interior

**Error:** Player cannot enter the warehouse interior or gets stuck.

#### Possible Causes

* Invalid interior coordinates
* IPL not loaded properly
* Bucket system issues
* Player positioning problems

#### Solutions

1. **Check Coordinates:** Verify interior coordinates in config.lua
2. **IPL Loading:** Ensure the interior IPL is loaded correctly
3. **Bucket Reset:** Try resetting the player's bucket
4. **Position Check:** Verify player is at the correct entrance location

\-- Reset player bucket

&#x20;`TriggerServerEvent('sergeis-warehouse:server:setBucket', 0)`

&#x20;\-- Check interior coordinates&#x20;

`Config.Warehouse.interiorAnchor = vector4(1094.988, -3101.776, -39.00363, 0.0)`

### ❌ Sharing system not working

**Error:** Players cannot share warehouses or access shared warehouses.

#### Possible Causes

* Sharing system disabled in config
* Database table issues
* Player detection problems
* Server-side script errors

#### Solutions

1. **Enable Sharing:** Set `Config.Sharing.enabled = true`
2. **Database Check:** Verify warehouse\_sharing table exists
3. **Player Distance:** Ensure players are within 50 meters
4. **Server Logs:** Check server console for sharing-related errors

\-- Check sharing configuration Config.Sharing = { enabled = true, maxSharedUsers = 10, allowTemporaryAccess = true } -- Check sharing table SELECT \* FROM warehouse\_sharing;

### ❌ Database connection errors

**Error:** Database-related errors in server console.

#### Possible Causes

* MySQL server not running
* Incorrect database credentials
* Database tables not created
* oxmysql connection issues

#### Solutions

1. **MySQL Status:** Check if MySQL server is running
2. **Credentials:** Verify database connection settings
3. **Import SQL:** Run the warehouse.sql file to create tables
4. **oxmysql Check:** Ensure oxmysql is properly configured

\-- Check MySQL status systemctl status mysql -- Import database mysql -u username -p database\_name < sql/warehouse.sql -- Check oxmysql configuration -- Verify oxmysql is in server.cfg and properly configured

### 🔍 Debug Information

Enable debug mode to get detailed logging information for troubleshooting:

\-- Enable debug mode in config.lua Config.Debug = true

#### Debug Information Includes

* Detailed console output for all warehouse operations
* Database query logging
* Player interaction tracking
* Sharing system activity
* Storage access logging

**⚠️ Performance Note:** Debug mode can generate a lot of console output. Disable it in production to avoid performance issues.

### 🛠️ Advanced Troubleshooting

For more complex issues, try these advanced troubleshooting steps:

#### Resource Loading Order

\-- Ensure proper loading order in server.cfg ensure qb-core ensure oxmysql ensure ox\_target -- or qb-target ensure ox\_inventory -- or qb-inventory ensure sergeis-warehouse

#### Database Verification

\-- Check all warehouse tables exist SHOW TABLES LIKE 'warehouse%'; -- Verify table structure DESCRIBE warehouses; DESCRIBE warehouse\_storage; DESCRIBE warehouse\_sharing;

#### Client-Side Debugging

\-- Check for JavaScript errors in browser console -- Open F12 developer tools and check console tab -- Look for any red error messages

### 📞 Getting Help

If you're still experiencing issues after trying these solutions:

#### Information to Provide

* Server console error messages
* Client console error messages
* Steps to reproduce the issue
* Server configuration details
* Resource versions and dependencies

#### Common Solutions

* Restart the warehouse resource
* Restart the entire server
* Check resource dependencies
* Verify database connection
* Update resource files

**✅ Quick Fixes:** Many issues can be resolved by simply restarting the resource or checking the basic configuration. Always try the simple solutions first before moving to more complex troubleshooting.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sergeis-scripts.gitbook.io/sergeis-scripts-docs/sergeis-warehouse/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
