• AVR Freaks

Hot!Build fails for lack of permission to delete/modify file it just created.

Author
JJay
Starting Member
  • Total Posts : 47
  • Reward points : 0
  • Joined: 2012/09/07 07:41:08
  • Location: 0
  • Status: offline
2020/08/14 12:00:43 (permalink)
5 (1)

Build fails for lack of permission to delete/modify file it just created.

This may be an MPLAB-X issue as I've seen similar with the XC8 compiler, and multiple versions of MPLAB-X.  Currently using v5.40 or v5.15.
 
Basically, I can build my project just fine, repeatedly.  Then for some reason the build fails because it can't delete or rewrite the output .hex file.  Sometimes I get a permission denied message, other times I get what's listed below.
"C:\Program Files\Microchip\xc16\v1.50\bin"\\xc16-bin2hex dist/default/production/myProj.X.production.elf -a -omf=elf
Error: could not open file dist/default/production/myProj.X.production.hex for writing!
nbproject/Makefile-default.mk:530: recipe for target 'dist/default/production/myProj.X.production.hex' failed
make[2]: Leaving directory 'U:/Projects/myProj/Firmware/jjh_002/myProj.X'
nbproject/Makefile-default.mk:103: recipe for target '.build-conf' failed
make[1]: Leaving directory 'U:/Projects/myProj/Firmware/jjh_002/myProj.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/myProj.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
I cannot delete myProj.X.production.hex at all! 
 
While all the tools are local, the drive where my project is stored is a mapped network drive my company wants me to use since it's backed up every night.  I've used this method for years with MPLAB-X and intermittently I've hit this.  Sometimes rebooting my PC fixes my ability to delete this file.  Sometimes not, like today, again.  The IT guys sometimes can't delete it without using fancier tools.
 
This is occurring much more frequently since I started using MPLAB-X v5.x.
 
What's causing this and how can I prevent it from occurring in the future?
Storing my project locally is not a good solution.  I've had this issue locally, too, with previous versions of MPLAB-X.  The exception being that rebooting has fixed my ability to delete the file since I also have admin rights for my local machine.
 
Thoughts?
 
Regards,
-j
#1

10 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6736
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 12:13:26 (permalink)
    +1 (1)
    I have had some success using Procmon to watch just what MpLabX is trying to do when it fails.
    https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
    #2
    du00000001
    Just Some Member
    • Total Posts : 3946
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: online
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 12:23:39 (permalink)
    0 (2)
    My guess: network performance problems  :(
    Might be your credentials are not received prior the requester hits its timeout.
     
    Why not mirror the project to your local disk? Or even have a repository on the network drive - working locally and checking in atvwell-defined points?

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    Antipodean
    Super Member
    • Total Posts : 1906
    • Reward points : 0
    • Joined: 2008/12/09 10:19:08
    • Location: Didcot, United Kingdom
    • Status: online
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 13:23:23 (permalink)
    +2 (2)
    JJay
    What's causing this and how can I prevent it from occurring in the future?
    Storing my project locally is not a good solution.  I've had this issue locally, too, with previous versions of MPLAB-X.  The exception being that rebooting has fixed my ability to delete the file since I also have admin rights for my local machine.

     
    This sounds to me like the IT guys have stuffed up something, especially as you have seen similar problems with your local machine.
     
     

    Do not use my alias in your message body when replying, your message will disappear ...

    Alan
    #4
    Jim Nickerson
    User 452
    • Total Posts : 6736
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 13:47:44 (permalink)
    +1 (1)
    Did someone quote Alan ?
    #5
    JJay
    Starting Member
    • Total Posts : 47
    • Reward points : 0
    • Joined: 2012/09/07 07:41:08
    • Location: 0
    • Status: offline
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 13:52:50 (permalink)
    0
    Network performance may contribute to this issue, but it's not the root cause.  If it didn't occur locally, too, I'd totally blame IT.  I don't believe the anti-malware installed locally is that draconian for local building to have this issue.
     
    I started to look at procmon.  That's a fire hose of info!  All good I'm sure.  I will need to figure out how to filter it down to see the failure of a file lock release, before the build failure caused by the lock still existing. 
     
    Do you have any pointers on efficient filtering for procmon?
     
    Thank you,
    -j
    #6
    JJay
    Starting Member
    • Total Posts : 47
    • Reward points : 0
    • Joined: 2012/09/07 07:41:08
    • Location: 0
    • Status: offline
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 14:00:52 (permalink)
    +1 (1)
    I tried to respond a few times before it actually worked.  If I had the 'at' symbol and any of your displayed names, the message didn't post.  I never actually used Alan's full alias name.  I also didn't quote any other posts.
     
    Is using the 'at' symbol bad on this forum?
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6736
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/14 14:06:29 (permalink)
    +1 (1)
    I filter procmon on mplab.
    #8
    JJay
    Starting Member
    • Total Posts : 47
    • Reward points : 0
    • Joined: 2012/09/07 07:41:08
    • Location: 0
    • Status: offline
    Re: Build fails for lack of permission to delete/modify file it just created. 2020/08/17 11:38:09 (permalink)
    +1 (1)
    Initially, IT was able to move the file within my network storage drive, but not delete it.  They could rename it, too.  Once they moved and renamed it, I, too, could move and rename it.  Eventually, IT found a way to delete it.  So I can build again!
     
    I still don't know the root cause and I time is against me to debug and possibly recreate the issue. 
     
    'procmon' sounds like a good tool to possibly catch the culprit in the act.  Another mentioned handle.exe from the System Internals suite from Microsoft.
     
    When this happens again, maybe some of these tools will give me a clue.
     
    Best Regards,
    -j
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5