[GH-ISSUE #1613] Empty environmental variable results in fork/exec error #2952

Open
opened 2026-03-14 06:04:08 +03:00 by kerem · 0 comments
Owner

Originally created by @NiceGuyIT on GitHub (Aug 23, 2023).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1613

Server Info (please complete the following information):

  • OS: Ubuntu 20.04.4 LTS (Focal Fossa)
  • Browser: Firefox 116.0.2
  • RMM Version (as shown in top left of web UI): v0.16.3

Installation Method:

  • Standard
  • Docker

Agent Info (please complete the following information):

  • Agent version (as shown in the 'Summary' tab of the agent from web UI): Agent v2.4.11
  • Agent OS: Windows 11 Pro

Describe the bug
When an environmental variable is added but doesn't have a value, a fork/exec C:\Program Files\TacticalAgent\py38-x64\python.exe: The parameter is incorrect. is thrown. Specifically, if you add NOT_SET to the environmental variables section, the error will be thrown. If you add NOT_SET=, the error is not thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Script Manager
  2. Create a new script
  3. Add a hello world to the script.
  4. Add a variable to the environmental variables section without adding the equals sign. For example: SOMETHING or NOT_SET or WHATEVER.
  5. Click on Test Script to run it on an agent.

Expected behavior
I would expect a better error message, perhaps something pointing me to an invalid environmental variable. For this one particular script, I had many env vars and the problematic variable was off the screen to the right. If you add a long environmental variable, the widget window size increases horizontally and variables can become hidden. See the 2nd and 3rd screenshots for an example.

Ideally, I don't want to waste time troubleshooting an issue on the agent (fork/exec) when it's actually a problem with the scripting parameters (The parameter is incorrect). Maybe provide which type of parameter is incorrect: "The environmental parameter(s) is incorrect".

Screenshots
image

This will also generate the error. The problematic variable is off the screen to the right as shown in the 2nd screenshot.
image

image

Additional context
Here's the output from the agent when run in debug mode.

time="2023-08-23T11:22:58-04:00" level=debug msg="fork/exec C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe: The parameter is incorrect."
Originally created by @NiceGuyIT on GitHub (Aug 23, 2023). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1613 **Server Info (please complete the following information):** - OS: Ubuntu 20.04.4 LTS (Focal Fossa) - Browser: Firefox 116.0.2 - RMM Version (as shown in top left of web UI): v0.16.3 **Installation Method:** - [x] Standard - [ ] Docker **Agent Info (please complete the following information):** - Agent version (as shown in the 'Summary' tab of the agent from web UI): Agent v2.4.11 - Agent OS: Windows 11 Pro **Describe the bug** When an environmental variable is added but doesn't have a value, a `fork/exec C:\Program Files\TacticalAgent\py38-x64\python.exe: The parameter is incorrect.` is thrown. Specifically, if you add `NOT_SET` to the environmental variables section, the error will be thrown. If you add `NOT_SET=`, the error is not thrown. **To Reproduce** Steps to reproduce the behavior: 1. Go to Script Manager 2. Create a new script 3. Add a hello world to the script. 4. Add a variable to the environmental variables section **without adding the equals sign**. For example: `SOMETHING` or `NOT_SET` or `WHATEVER`. 5. Click on Test Script to run it on an agent. **Expected behavior** I would expect a better error message, perhaps something pointing me to an invalid environmental variable. For this one particular script, I had many env vars and the problematic variable was off the screen to the right. If you add a long environmental variable, the widget window size increases horizontally and variables can become hidden. See the 2nd and 3rd screenshots for an example. Ideally, I don't want to waste time troubleshooting an issue on the agent (`fork/exec`) when it's actually a problem with the scripting parameters (`The parameter is incorrect`). Maybe provide which type of parameter is incorrect: "The environmental parameter(s) is incorrect". **Screenshots** ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/2d1eb1ed-45f4-4539-bd6f-fc39a132999f) This will also generate the error. The problematic variable is off the screen to the right as shown in the 2nd screenshot. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/90557c46-aa6a-440f-a203-a6f7561b15d2) ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/0d35376f-bf18-4d1c-991c-b04f015b8954) **Additional context** Here's the output from the agent when run in debug mode. ```text time="2023-08-23T11:22:58-04:00" level=debug msg="fork/exec C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe: The parameter is incorrect." ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#2952
No description provided.