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

leofabri
Posts: 9
Joined: Wed Feb 19, 2020 3:36 pm

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

Postby leofabri » Fri Feb 21, 2020 10:02 am

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.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

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

Postby ESP_Dazz » Sun Feb 23, 2020 10:20 pm

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.

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

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

Postby gunar.kroeger » Fri Mar 13, 2020 6:44 pm

I'm getting the same on VS Code extension. Reopening VS Code solves the problem.
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

leofabri
Posts: 9
Joined: Wed Feb 19, 2020 3:36 pm

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

Postby leofabri » Fri Mar 27, 2020 9:54 am

For some reason. This has never happened again since this post :?:

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

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

Postby gunar.kroeger » 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
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

leofabri
Posts: 9
Joined: Wed Feb 19, 2020 3:36 pm

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

Postby leofabri » Sat Mar 28, 2020 2:08 pm

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:

spirail
Posts: 1
Joined: Tue May 19, 2020 2:19 pm

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

Postby spirail » Tue May 19, 2020 2:22 pm

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.

tyavashev
Posts: 1
Joined: Thu May 21, 2020 1:26 pm

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

Postby tyavashev » Thu May 21, 2020 1:40 pm

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 :)

adam_esp
Posts: 37
Joined: Mon Apr 29, 2019 12:09 pm

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

Postby adam_esp » Mon Apr 12, 2021 11:23 am

Did anyone fix it?
This is annoying because it is often confused with ctrl + B.

eggnogg
Posts: 4
Joined: Sun Jan 17, 2021 5:27 pm

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

Postby eggnogg » Wed Jun 02, 2021 5:23 am

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

Who is online

Users browsing this forum: Bing [Bot], heydarov23, maghost, SvanteKaiser and 114 guests