AGS 3.5.0 Patch 4 - Path Access Denied Error

Started by ToeKnee, Fri 25/09/2020 16:48:26

Previous topic - Next topic

ToeKnee

I am getting a AGS 3.5.0 Patch 4 issue. It is during compiling the game for full REBUILD ALL FILES - it will COMPILE the game fine, but selecting REBUILD ALL fails and it then make the IDE unstable.
Note 1: Running AGS under Win-10 as ADMINISTRATOR on the exe to ensure permissions are ok does not work either.
Note 2: I just updated to this patch version (From AGS 3.5.0 Patch 1, Dec 2019)
Note 3: Reverting back to AGS 3.5.0 Patch 1, produces the same error.

The following is the error log
___________________________________________________________

Error: Access to the path 'AudioCache\au000034.mp3' is denied.
Version: AGS 3.5.0.26

System.UnauthorizedAccessException: Access to the path 'AudioCache\au000034.mp3' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at AGS.Editor.Components.AudioComponent._agsEditor_PreCompileGame(PreCompileGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.PreCompileGameHandler.Invoke(PreCompileGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.CompileGame(Boolean forceRebuild, Boolean createMiniExeForDebug)
   at AGS.Editor.Components.BuildCommandsComponent.CompileGame(Boolean forceRebuild)
   at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If it’s not broken, let’s fix it till it is...!

morganw

Without doing anything in AGS, can you open the file 'AudioCache\au000034.mp3' ?

Crimson Wizard

Quote from: morganw on Fri 25/09/2020 18:12:38
Without doing anything in AGS, can you open the file 'AudioCache\au000034.mp3' ?

Yes, and firstly, does it exist?

I wonder if something was deleted in the past, but the reference to this file remained, or audio cache could not be recreated because original source file changed/missing.

ToeKnee

Yes - File EXISTS (In the right directory for the loaded AGS Game)
Yes - File OPENS and can be played in Audacity (correct music plays flawlessly as well - backdrop music for a room)

Also, the following don't reveal the issue yet either;

  • Can BACKUP and MOVE replacement file into it's place (replace) and same error appears
  • File checking shows this file is SAME permissions as all other files in AudioCache
  • File is not READ-ONLY or any other way different?(Windows file permission/s)
  • File is not 'new' or a recent change in AGS in any way
  • In the end I Renamed AudioCache to 'OLD-AudioCache' and then copied the ENTIRE Directory and files from a full directory backup I had done just 6 days ago (but MANY compiles before this error showed up).... and..... SAME ERROR!
I'll keep looking into it tonight.
If it’s not broken, let’s fix it till it is...!

ToeKnee

Hmmm... I still can't find it yet. It may need the AGS heavy hitters to keep assisting.
I read up on the copying of the Sound files into AudioCache by AGS - for backup 'in case' the source(s) are changed or removed - then AGS can still compile/use these audio files etc, and that all makes sense....

There are weird issue(s) I am seeing on this though - since the problem changes a bit during the testing of various items and can be DIFFERENT for the same test - eg: if you try something and get an error and then RESTART AGS from scratch, open the game and re-try the same operation (example below).... the error may change. COuld be as simple as the 'random' reading of files in AudioCache and just hitting an issue with the first file but it does seem odd...

Fault finding of course takes a systematic approach and ONE change at a time for results to make sense.... nothing makes sense on this atm.
If I load AGS onto a new computer and then try it out entirely then maybe I can compare properly, since atm I cannot even re-compile the game at all.

I did get one of those 'wonderful' darn Windows-10 AUTO-Updates a few days ago so I wonder if it is a coincidence or (more likely) Windows update/s have stuffed this up.... (I had put it off the Windows Patch update for a while since these are terribly problematic atm - another whole story)


So - for an Error example atm: Access to the path 'AudioCache\au00003C.ogg' is denied.
If I go and check OFF the directory for READ only access and click OK in Windows then it 'propogates' (pretends to at least) those read only file attributes onto all files WITHIN the source Sound directory (where I load my sounds into and AGS gets them, and the same if I do this to the AudioCache directory....

I was able to get past that file error above (3C) ONCE.... then when I tried to DELETE a Audio file (so I could just reload with the same name) I got
- Error: Unable to delete the file 'C:\Users\admin\Documents\AGS GAME BACKUP\KingReturn\AudioCache\au000050.mp3'.
- Access to the path 'C:\Users\admin\Documents\AGS GAME BACKUP\KingReturn\AudioCache\au000050.mp3' is denied.

RENAMING the Audio file in AudioCache and then try to delete from AGS Audio (see the SAME filename used in the audio entry) get the following (weird) error;
Error: Object reference not set to an instance of an object.
Version: AGS 3.5.0.23

However on CLOSING AGS and restart this error CHANGES when trying to delete the file! (so the checking is different...);
- Error: Unable to delete the file 'C:\Users\admin\Documents\AGS GAME BACKUP\KingReturn\AudioCache\au000050.mp3'.
- Access to the path 'C:\Users\admin\Documents\AGS GAME BACKUP\KingReturn\AudioCache\au000050.mp3' is denied.

Argh... anyway any help would be great.
If it’s not broken, let’s fix it till it is...!

Crimson Wizard

#5
Do you still have all the original audio files in same place where you imported them from? If yes, maybe you could try deleting AudioCache and let AGS rebuild it to see what happens (sorry if I missed this in above text and you already did that - there are a lot of steps mentioned...)

If this continues, do you have any antivirus or other protection running at the moment, like Windows Defender and whatnot? AGS had some problems with antiviruses in the past, so this may be also an option to check.

Quote from: ToeKnee on Sat 26/09/2020 13:44:46
RENAMING the Audio file in AudioCache and then try to delete from AGS Audio (see the SAME filename used in the audio entry) get the following (weird) error;
Error: Object reference not set to an instance of an object.
Version: AGS 3.5.0.23

This one sounds like a mistake in AGS itself, maybe it cannot handle missing audio cache file. Worth fixing, but I doubt that will have any impact on above problem of course.
EDIT: i was not able to reproduce this though... what were the actual steps to get this "reference not set" error?

ToeKnee

Yes I use Antivirus - Avast Free Antivirus - Ver 20.7.2425 - September 1, 2020.
This update was WAY before I compiled a ton of versions over and over in readiness for release so I know it's not a recent version/update change.
I checked anyway and had also EXCLUDED the entire AGS and Game Directories back in March 2020 since it would always scan on re-build.
- I re-checked and all Sound, Game and build directories are absolutely included
On checking the VIRUS CHEST has nothing related to AGS residing within it
'Silent Mode' was on so tried with that OFF but no change to the error(s)either

I remember I had made a recent change rior to release - to NORMALISE all Audio across the game - including this ROOM (music) sounds.
Any sound files that were WAV I set on MP3 across the board so I had
- loaded the WAV, Set the sound / normalised audio levels in Audacity, Exported as MP3 and then COMMENTED out the usage spots in AGS, deleted the original (WAV) Sound from AGS, Imported the MP3 replacement (SAME NAME) and then UNCOMMENTED the usage spots.... which seemed to work well.

I think this issue is caused by INITIALLY setting a Sound file for one format (Eg: WAV for me), then Exporting the original as another format (eg: MP3 with updated levels), deleting/re-copying the MP3 (with the SAME NAME) file into AGS in the one/open session.... I have to get it working to be able to test this theory though and see if it can be repeated to create the lockout.

I was able to just now get rid of the issue....
I re-installed AGS 3.5.0.26. Opening my game in AGS and trying to re-compile brought up a 'new' issue from Avast Antivirus!! - Trying to access a file in the 'Protected Document area'...? This is was odd (but GOOD to have something new!) since I had EXCLUDED the highest level of AGS and Game files (as per description above) so I now assume this was a SOUND file located OUTSIDE of the bounds of my exclusions... but AVAST was NOT telling me of the issue (silent mode?) and therefore 'hobbling' AGS so AGS could not access the file (as it was stating)... even though I could SEE the file, MOVE, ADD and CHANGE it something was wrong permission wise in Antivirus....

So voila... we have the culprit.
Thanks for your help, ideas and directions on this one guys!
If it’s not broken, let’s fix it till it is...!

Crimson Wizard

Quote from: ToeKnee on Sun 27/09/2020 12:17:37
Yes I use Antivirus - Avast Free Antivirus - Ver 20.7.2425 - September 1, 2020.

Avast HATES AGS.

SMF spam blocked by CleanTalk