Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.33k stars 910 forks source link

IO exception when starting 1 bot #374

Closed wizzyup closed 11 years ago

wizzyup commented 11 years ago

After I try to start the bot in the Bot Manager, I get this error about not being able to access the log file. I am only trying to run 1 bot so I do not see why I get this error.

ERROR:

System.IO.IOException: The process cannot access the file 'C:\Users\Wizzy\Documents\GitHub\SteamBot\Bin\Debug\TEST.log' because it is being used by another process. ---> System.Exception:

--- End of inner exception stack trace ---

at at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

at at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

at at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)

at at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)

at at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)

at at System.IO.StreamWriter..ctor(String path, Boolean append)

at at System.IO.File.AppendText(String path)

at SteamBot.Log..ctor(String logFile, String botName, LogLevel output) in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\Log.cs:0

at SteamBot.Bot..ctor(BotInfo config, String apiKey, UserHandlerCreator handlerCreator, Boolean debug, Boolean process) in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\Bot.cs:0

at SteamBot.BotManager.RunningBot.SpawnBotThread(BotInfo botConfig) in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\BotManager.cs:0

at SteamBot.BotManager.RunningBot.Start() in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\BotManager.cs:0

at SteamBot.BotManager.StartBot(Int32 index) in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\BotManager.cs:0

at SteamBot.BotManagerInterpreter.CommandInterpreter(String command) in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\BotManagerInterpreter.cs:0

at SteamBot.Program.BotManagerMode() in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\Program.cs:0

at SteamBot.Program.Main(String[] args) in c:\Users\Wizzy\Documents\GitHub\SteamBot\SteamBot\Program.cs:0
waylaidwanderer commented 11 years ago

Also:

wizzyup commented 11 years ago

@FunkyLoveCow There are 2 logs. The bot log and the system log. What do you mean by rewrite permissions? Do I have to enable these and how?

@waylaidwanderer I am trying to start ONE bot only. So there should not be a log file error. I understand you need a unique log file for each bot. However I am only starting one bot and encounter this error.

waylaidwanderer commented 11 years ago

@wizzyup Sorry, my mistake. It sounded like you were emphasizing the fact that it was only happening on one bot, implying that you were running other bots. I probably just failed at reading.

wizzyup commented 11 years ago

@waylaidwanderer No worries mate. I've got no idea why I get this error. I have just cloned the repo and tried to start a bot and it states the logs are been used by another process.

wizzyup commented 11 years ago

@FunkyLoveCow Don't worry about it. I cloned the repo again and its all working.