Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: The STDIO streams did not close within 10 seconds of the exit event from process '/usr/bin/bash' #18476

Open
1 of 4 tasks
zlee520 opened this issue Jun 10, 2023 · 6 comments
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work Need more info Task: Bash

Comments

@zlee520
Copy link

zlee520 commented Jun 10, 2023

Task name

https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line

Task version

2.201.1

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

Azure DevOps Server 2022

Operation system

Ubuntu 20.04

Question

can not run java webapp

pipelines YAML: ----------------------------------------------------

steps:
- script: |
   cd /home/ubuntu/project/stock
   nohup java -jar home-admin-0.0.1-SNAPSHOT.jar &

  displayName: start
  continueOnError: true
  timeoutInMinutes: 50

----------------------------------------------------------------------------

2023-06-10T13:12:26.2504639Z ##[section]正在启动: start
2023-06-10T13:12:26.2522099Z ==============================================================================
2023-06-10T13:12:26.2523162Z Task         : 命令行
2023-06-10T13:12:26.2523583Z Description  : 在 Linux 和 macOS 上使用 Bash、在 Windows 上使用 cmd.exe 运行命令行脚本
2023-06-10T13:12:26.2524385Z Version      : 2.201.1
2023-06-10T13:12:26.2524850Z Author       : Microsoft Corporation
2023-06-10T13:12:26.2525420Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2023-06-10T13:12:26.2527084Z ==============================================================================
2023-06-10T13:12:26.7230417Z 正在生成脚本。
2023-06-10T13:12:26.7268014Z ========================== Starting Command Output ===========================
2023-06-10T13:12:26.7346994Z [command]/usr/bin/bash --noprofile --norc /home/ubuntu/azagent/_work/_temp/36772aca-8ad3-4fd4-82dd-a308f56afe44.sh
2023-06-10T13:12:31.7576219Z 
2023-06-10T13:12:31.7597526Z   .   ____          _            __ _ _
2023-06-10T13:12:31.7603012Z  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
2023-06-10T13:12:31.7606636Z ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2023-06-10T13:12:31.7610016Z  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
2023-06-10T13:12:31.7612974Z   '  |____| .__|_| |_|_| |_\__, | / / / /
2023-06-10T13:12:31.7616550Z  =========|_|==============|___/=/_/_/_/
2023-06-10T13:12:31.7700929Z  :: Spring Boot ::               (v2.7.12)
2023-06-10T13:12:31.7728655Z 
2023-06-10T13:12:36.7592276Z The STDIO streams did not close within 10 seconds of the exit event from process '/usr/bin/bash'. This may indicate a child process inherited the STDIO streams and has not yet exited.
2023-06-10T13:12:41.7795837Z ##[section]即将完成: start
@github-actions github-actions bot added Area: Release triage Area: ABTT Akvelon Build Tasks Team area of work Task: Bash labels Jun 10, 2023
@KonstantinTyukalov
Copy link
Contributor

Hi @zlee520, this message means that the bash child process is not finished.

As I see it, you are trying to run your application in the background, so in this case the pipeline task will not wait for the background process to finish.
But this should not be the reason for the task to fail.

What problem are you seeing in this case?
And could you explain what you are trying to do and what result do you expect?

@zlee520
Copy link
Author

zlee520 commented Jun 16, 2023

Hi @zlee520, this message means that the bash child process is not finished.

As I see it, you are trying to run your application in the background, so in this case the pipeline task will not wait for the background process to finish. But this should not be the reason for the task to fail.

What problem are you seeing in this case? And could you explain what you are trying to do and what result do you expect?

hello, I want to start a java app, this task is successfull but the java app not started
running the same command directly on the server can start the app

Viir added a commit to pine-vm/pine that referenced this issue Jul 2, 2023
With the previous version, Azure Pipeline sometimes failed the execution of the tests, not completing the test step.
Looking into these failures, I also found the following message in the logs from Azure Pipelines:

> The STDIO streams did not close within 10 seconds of the exit event from process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

For discussions of the problem, see also:

+ microsoft/azure-pipelines-tasks#17548
+ microsoft/azure-pipelines-tasks#13033
+ microsoft/azure-pipelines-tasks#18476
Viir added a commit to pine-vm/pine that referenced this issue Jul 2, 2023
With the previous version, Azure Pipeline sometimes failed the execution of the tests, not completing the test step.
Looking into these failures, I also found the following message in the logs from Azure Pipelines:

> The STDIO streams did not close within 10 seconds of the exit event from process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

For discussions of the problem, see also:

+ microsoft/azure-pipelines-tasks#17548
+ microsoft/azure-pipelines-tasks#13033
+ microsoft/azure-pipelines-tasks#18476
Viir added a commit to pine-vm/pine that referenced this issue Jul 2, 2023
With the previous version, Azure Pipeline sometimes failed the execution of the tests, not completing the test step.
Looking into these failures, I also found the following message in the logs from Azure Pipelines:

> The STDIO streams did not close within 10 seconds of the exit event from process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

For discussions of the problem, see also:

+ microsoft/azure-pipelines-tasks#17548
+ microsoft/azure-pipelines-tasks#13033
+ microsoft/azure-pipelines-tasks#18476
@sushilInfy
Copy link

Hi ,
Do we have any resolution for it ?
We are also facing the same thing.

@ArwynFr
Copy link

ArwynFr commented Nov 16, 2023

@KonstantinTyukalov
I have a similar problem than OP but with pwsh task, behaves similarly to bash:

steps:
- pwsh: docker build .

In my exemple I'm trying to build a docker image, which takes around 3 minutes. The problem I'm facing is that the error provokes a failure of the step, even though the build continues and succeeds. I don't want to use continueOnError: true because then I wouldn't fail the step when the docker image fails to build.

As I see it, you are trying to run your application in the background, so in this case the pipeline task will not wait for the background process to finish.
But this should not be the reason for the task to fail.

The step actually runs to completion AND fails because of that error.

I don't understand why this is a topic in the first place.
Pipelines are expected to run long running processes that use STDIO to provide some output.
This shouldn't even yield a warning, the task should simply wait for the process to complete.

@ArwynFr
Copy link

ArwynFr commented Nov 16, 2023

Please note, this works fine for me on Windows agents, it only fails on Linux agents.

$ uname -a
Linux hostname 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@mahomedalid
Copy link

Probably related to #19844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work Need more info Task: Bash
Projects
None yet
Development

No branches or pull requests

6 participants