Page 1 of 1

Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Fri Feb 21, 2020 10:02 am
by leofabri
Hi,
this is my setup:
  • OS: Windows 10 Pro Inisider Preview, Build 19569
  • xtensa-esp32-elf: esp-2019r2-8.2.0
  • esp32ulp-elf: 2.28.51.20170517
  • cmake: 3.13.4
  • openocd-esp32: v0.10.0-esp32-20190313
  • mconf: v4.6.0.0-idf-20190628
  • ninja: 1.9.0
  • idf-exe: 1.0.1
  • ccache: 3.7
  • python: py3.7
  • ESP-IDF: V4.0
When I try to issue idf.py build I occasionally receive the following error.

Code: Select all

C:\development\app>idf.py build flash monitor
Checking Python dependencies...
Python requirements from C:\development\esp\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running ninja in directory c:\development\app\build
Executing "ninja all"...
ninja: error: opening build log: Permission denied
ninja failed with exit code 1

C:\development\app>
I don't understand why this happens. Moreover, it's almost impossible for me to reproduce the error because it's happening sporadically when I'm building multiple times the same project.
I understand that the issue is related to Ninja but I have no clue about how to solve it. I noticed that when I restart the PC the problem disappears.

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Sun Feb 23, 2020 10:20 pm
by ESP_Dazz

Code: Select all

ninja: error: opening build log: Permission denied
It might be ninja trying to write to some log file, but it can't open it because the operating system is locking the file. Could be cause by another process/program using the same file simultaneously.

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Fri Mar 13, 2020 6:44 pm
by gunar.kroeger
I'm getting the same on VS Code extension. Reopening VS Code solves the problem.

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Fri Mar 27, 2020 9:54 am
by leofabri
For some reason. This has never happened again since this post :?:

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Fri Mar 27, 2020 11:41 am
by gunar.kroeger
I can confirm that posting to the forum solves the issue. hahahah
but I saw it happening a few times with 3 computers

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Sat Mar 28, 2020 2:08 pm
by leofabri
gunar.kroeger wrote:
Fri Mar 27, 2020 11:41 am
I can confirm that posting to the forum solves the issue. hahahah
but I saw it happening a few times with 3 computers
Hahaha :lol:

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Tue May 19, 2020 2:22 pm
by spirail
I'm using the official Eclipse environment and this happens when i try to build twice in a row too quickly (typically because i did ctrl+b, but really i wanted to click the build icon).

Its really annoying, but its fixed by simply restarting eclipse.

Since it happens very often it means I have to run a lot of my development environment (servers etc) outside of eclipse.

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Thu May 21, 2020 1:40 pm
by tyavashev
I also can confirm that it happens, when I click ctrl+b instead of the hammer icon. I have no idea what is the actual difference. Once its happens I can't build it anymore, no mather that I'm clicking the hammer icon, untless I restart the eclipse. So, my advice is - don't use any other "build" command than the hammer icon :)

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Mon Apr 12, 2021 11:23 am
by adam_esp
Did anyone fix it?
This is annoying because it is often confused with ctrl + B.

Re: Occasional "ninja: error: opening build log: Permission denied" when building project

Posted: Wed Jun 02, 2021 5:23 am
by eggnogg
adam_esp wrote:
Mon Apr 12, 2021 11:23 am
Did anyone fix it?
This is annoying because it is often confused with ctrl + B.
Nope, still happens on IDF 4.2.1