# Failed to execute /app/your\_program.sh: fork/exec /app/your\_program.sh: permission denied

**URL:** <https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [December 21, 2024, 6:52pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590 "2024-12-21T18:52:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kin1m0d](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/kin1m0d/32/3619_2.png) [@kin1m0d](https://forum.codecrafters.io/u/kin1m0d)\
**Post date:** [December 21, 2024, 6:52pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590/1 "2024-12-21T18:52:47Z")

</div>

Hello all, I’m stuck on Stage #(The type builtin: executable files #mg5).

Here are my logs:

```auto
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
Debug = true
[tester::#OO8] Running tests for Stage #OO8 (Print a prompt)
[tester::#OO8] Running ./your_program.sh
[tester::#OO8] Failed to execute /app/your_program.sh: fork/exec /app/your_program.sh: permission denied
[tester::#OO8] Test failed

```

Locally everything works fine, for some reason “codecrafters test --previous” fails as well

```auto
Initiating test run...

⚡ This is a turbo test run. https://codecrafters.io/turbo

Running tests. Logs should appear shortly...

[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.

Debug = true

[tester::#OO8] Running tests for Stage #OO8 (Print a prompt)
[tester::#OO8] Running ./your_program.sh
[tester::#OO8] Failed to execute /app/your_program.sh: fork/exec /app/your_program.sh: permission denied
[tester::#OO8] Test failed

```

That makes me believe something is wrong with the test jobs 🤔  
And I don’t really understand why it says /app/your\_program.sh, where is the app coming from?

One thing to note, when I started this challenge I was on WSL Ubuntu, now I have moved the whole folder to my laptop, just Ubuntu no Windows. (I don’t have access to my desktop PC for the next few weeks). But again, I think it’s something with the test jobs because locally everything works 🤔

Thanks for your help!

* * *

_/edit_

1. I made sure that the file is executable

```bash
-rwxrwxrwx 1 *************** 818 Dec 21 18:28 your_program.sh*

```

1. On my laptop I’m also using a differnt user name and email, I wouldn’t expect that to be an issue though

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [December 21, 2024, 7:04pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590/2 "2024-12-21T19:04:48Z")

</div>

Hi @kin1m0d, we’ll investigate and get back to you with an update next week. Thanks for highlighting the issue!

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [December 21, 2024, 8:22pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590/4 "2024-12-21T20:22:29Z")

</div>

We’ve fixed your repo by restoring the `execute` permissions for the files in the .codecrafters folder.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/c/c03e3d3e3e266af6a4e0050b82400b647452e647.png)

Let us know if you encounter any further issues!

---

<div class="post-metadata">

**Author:** ![kin1m0d](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/kin1m0d/32/3619_2.png) [@kin1m0d](https://forum.codecrafters.io/u/kin1m0d)\
**Post date:** [December 21, 2024, 8:32pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590/5 "2024-12-21T20:32:45Z")

</div>

Thanks a lot that was it!!

I just wonder how this happened, I noticed that those two files were shown as modified but didn’t think about it.

But is that not a potential security risk if I’m able to modify scripts that will be automatically executed on some other machines? 🤔

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [December 21, 2024, 8:39pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590/6 "2024-12-21T20:39:51Z")

</div>

Your code is executed within a secure, sandboxed environment to ensure it doesn’t pose any security risks to other systems. Let us know if you have any further questions or concerns!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [December 27, 2024, 5:08pm UTC](https://forum.codecrafters.io/t/failed-to-execute-app-your-program-sh-fork-exec-app-your-program-sh-permission-denied/3590/8 "2024-12-27T17:08:47Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
