Raised This Month: $51 Target: $400
 12% 

Solved nvault crashing the server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-11-2017 , 12:12   nvault crashing the server
Reply With Quote #1

im using to store data nvault and its crashing the server when map change or restart
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-12-2017 at 11:08.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-11-2017 , 12:32   Re: nvault crashing the server
Reply With Quote #2

Your post could explode from so much information!
__________________

Last edited by OciXCrom; 03-11-2017 at 12:32.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-11-2017 , 12:40   Re: nvault crashing the server
Reply With Quote #3

Taking a guess here but could be a corrupt vault. Try deleting the vault and restarting the server. Commonly happens when the vault is not closed gracefully after a server crash.
__________________
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-11-2017 , 13:48   Re: nvault crashing the server
Reply With Quote #4

yeah Bugsy after i delete the vaults it stops the crashes but comes back again on map change in which forward is the best thing to close the vault!
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-11-2017 at 13:48.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-11-2017 , 14:02   Re: nvault crashing the server
Reply With Quote #5

In plugin_end? To prevent such crashes, check if the key that is being saved is not empty. This has happened to me before when saving data with bots. Their name/ip/steam would come up blank.
__________________

Last edited by OciXCrom; 03-11-2017 at 15:36.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-11-2017 , 15:22   Re: nvault crashing the server
Reply With Quote #6

Show all code where data gets written to the vault. If you were never calling nvault_close() then you are asking for trouble.

OciXCrom, nVault should allow empty keys and data.
__________________

Last edited by Bugsy; 03-11-2017 at 15:22.
Bugsy is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-11-2017 , 15:39   Re: nvault crashing the server
Reply With Quote #7

I meant the key, not the data, my bad. I was trying to understand why the server is crashing and I used your nVault editor to check the vault file while the server was crashing on startup. The key value was blank and deleting it fixed the problem (deleting the entire vault file did the job as well). The crashes stopped for good after checking if the key is empty and not saving if it is.

Now, I don't know if it was really the key that's empty or the entire vault entry was corrupted, but I do know that a simple if(!szKey[0]) return check fixed it.
__________________

Last edited by OciXCrom; 03-11-2017 at 15:40.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-11-2017 , 18:14   Re: nvault crashing the server
Reply With Quote #8

What happens if i saved empty data ?

I open the vault in plugin cfg
I close the vault in plugin end

Loading the data at client authorization
Saving at client disconnect

Key is authid

And what nvault_get returns when no key found

I also save empty data
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-11-2017 at 18:19.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-11-2017 , 19:16   Re: nvault crashing the server
Reply With Quote #9

Nothing happens, nvault allows saving empty data.

Your timing for doing things looks good.

nvault_get() needs to be used carefully. If you want to retrieve data and know when the key did or did not exist, use nvault_lookup().

Example: nvault_get() will return 0 when it found the key and the value is 0 and it will do the same if no key is found at all. Its useful because you can read directly into an integer or float variable but you need to know what you're doing when coding.
__________________

Last edited by Bugsy; 03-11-2017 at 19:16.
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-12-2017 , 06:17   Re: nvault crashing the server
Reply With Quote #10

So what nvautl get returns when i saved in a key value 5 as integer
Dose it returns 5 or 0?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-12-2017 at 06:24.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode