Server not able to write files?

User avatar
Edge100x
Founder
Founder
Posts: 12947
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Server not able to write files?

Post by Edge100x »

What is the current line?
Pvt_Kirby
New to forums
New to forums
Posts: 5
Joined: Sat May 05, 2012 5:55 am

Re: Server not able to write files?

Post by Pvt_Kirby »

Error message:
L 05/05/2012 - 08:44:33: Start of error session.
L 05/05/2012 - 08:44:33: Info (map "dod_chemille") (file "addons/amxmodx/logs/error_20120505.log")
L 05/05/2012 - 08:44:33: Couldn't create temp file
L 05/05/2012 - 08:44:33: [AMXX] Displaying debug trace (plugin "dodx_tk_manager.amxx")
L 05/05/2012 - 08:44:33: [AMXX] Run time error 10: native error (native "write_file")
L 05/05/2012 - 08:44:33: [AMXX] [0] 1549.attach::client_disconnect (line 163)

I cannot find in the sma where the debug temp file is to be written.
User avatar
Edge100x
Founder
Founder
Posts: 12947
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Server not able to write files?

Post by Edge100x »

It appears that this is a more fundamental bug, in AMXx itself --when a plugin attempts to write a line to an existing file, AMXx uses the tmpfile() function (in file.cpp), which requires write access to c:\ (which servers can't have, for obvious security reasons). The better way to create a temporary file would be to use GetTempFileName() and related functions, as it allows specifying a prefix.
cpgaming
A semi-regular
A semi-regular
Posts: 21
Joined: Tue Feb 07, 2012 8:12 pm
Location: New Jersey

Re: Server not able to write files?

Post by cpgaming »

Y060N wrote:Ok another problem again with writing files. These files have all permission set by myself, even though by default they were given full access.

L 01/17/2012 - 09:39:12: Couldn't create temp file
L 01/17/2012 - 09:39:12: [AMXX] Run time error 10 (plugin "amx_settings_api.amxx") (native "write_file") - debug not enabled!
L 01/17/2012 - 09:39:12: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 01/17/2012 - 09:39:12: Unhandled dynamic native error
L 01/17/2012 - 09:39:12: [AMXX] Run time error 10 (plugin "zp50_gamemode_winos.amxx") (native "amx_save_setting_string_arr") - debug not enabled!
L 01/17/2012 - 09:39:12: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 01/17/2012 - 09:39:12: Couldn't create temp file
L 01/17/2012 - 09:39:12: [AMXX] Run time error 10 (plugin "amx_settings_api.amxx") (native "write_file") - debug not enabled!

Getting massive errors like this over and over and sometimes data is saves, other times there is no data saved.

I'd really like to know what the problem is and sort this out, as my server runs an XP plugin. This is pretty much the reason people like to stay in my server and come back.

Many thanks in advanced!

fix plugins
User avatar
Edge100x
Founder
Founder
Posts: 12947
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Server not able to write files?

Post by Edge100x »

cpgaming, that's the same bug in AMXModX that I explained above. This is something that the developers of AMXModX fundamentally should fix, in the manner I described, but the developer of a plugin could also work around it by saving files in a different way.
Pvt_Kirby
New to forums
New to forums
Posts: 5
Joined: Sat May 05, 2012 5:55 am

Re: Server not able to write files?

Post by Pvt_Kirby »

Edge100x wrote:It appears that this is a more fundamental bug, in AMXx itself --when a plugin attempts to write a line to an existing file, AMXx uses the tmpfile() function (in file.cpp), which requires write access to c:\ (which servers can't have, for obvious security reasons). The better way to create a temporary file would be to use GetTempFileName() and related functions, as it allows specifying a prefix.
Could you please explain how to do this? I am not a programmer.
Can I edit the sma file to point the write function to within the server folder, then recompile it?

We have a managed VDS and do not have access to a lot of things.
Thanks
User avatar
Edge100x
Founder
Founder
Posts: 12947
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Server not able to write files?

Post by Edge100x »

That function is in AMXx itself, so fixing it would require recompiling AMXx. You could also potentially work around the use of that function by the plugin, such as by having it read in the file, change it, and save it back out. But, if you're not a programmer, fixing this may be difficult.
Pvt_Kirby
New to forums
New to forums
Posts: 5
Joined: Sat May 05, 2012 5:55 am

Re: Server not able to write files?

Post by Pvt_Kirby »

If you google "Displaying debug trace (plugin "dodx_tk_manager.amxx)" the only conversation that comes up is this one.
Might it be an NFO issue...?
User avatar
TimeX
Staff
Staff
Posts: 1730
Joined: Thu Jul 22, 2004 12:24 am
Location: Big Bear, CA

Re: Server not able to write files?

Post by TimeX »

It is specific to how we handle system security, as mentioned by Edge100x up above. Any other host following the same basic security practices will also have the same problem.
TimeX
Post Reply