Azure DevOps - Release Pipeline - Not able to run python script

Pavan Kumar 0 Reputation points
2023-08-16T03:57:10.0933333+00:00

Hello Experts,

I am running a release pipeline and in the process, trying to run the task in stage, using a python script.

However, when i run the release pipeline, it fails with below error:

2023-08-16T03:34:18.0263485Z ##[error]ENOENT: no such file or directory, stat '/home/vsts/work/r1/a/_IICS_Repo/iicsDeploy.py'

But the script has been created and placed under "Repo-->IICS_Repo".

What am i missing ?

Thanks,

Kumar

Community Center Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. RevelinoB 3,675 Reputation points
    2023-08-16T04:22:32.8566667+00:00

    Hi Pavan,

    The error message you're encountering, ENOENT: no such file or directory, stat '/home/vsts/work/r1/a/_IICS_Repo/iicsDeploy.py', indicates that the system is unable to find the file iicsDeploy.py in the specified directory. This issue could be due to various reasons. Here are a few things you can check to troubleshoot and resolve the problem:

    • File Path Check: Double-check the file path to ensure that it's accurate. It should be relative to the root of your repository. In your case, the correct path should be Repo/IICS_Repo/iicsDeploy.py (assuming Repo is the root directory of your repository).
    • Case Sensitivity: Be aware of case sensitivity in file paths. If your repository is hosted on a system with case-sensitive file paths (like many Linux systems), make sure the case of your file names and directory names match exactly.
    • Repository Contents: Confirm that the file iicsDeploy.py is actually present in the specified directory in your repository. You can do this by manually navigating to the directory and verifying the file's presence.
    • Repository Sync: Sometimes, there might be issues with repository synchronization. Try refreshing or syncing your repository to ensure that all the latest changes are being pulled down.
    • Build Agent Permissions: Ensure that the build agent or runner you're using for the release pipeline has the necessary permissions to access the repository and the file. Lack of permissions might prevent it from reading the file.
    • Caching: In some cases, caching might cause outdated files to be used. Try clearing any caches related to the pipeline or repository.
    • Pipeline Configuration: Check your pipeline configuration to make sure you're specifying the correct repository and branch.
    • Whitespace or Special Characters: Sometimes, invisible characters or special characters in file names or paths can cause issues. Ensure that there are no extra spaces or special characters in your file paths.
    • Logs and Diagnostics: Check if there are any additional logs or diagnostic messages provided by the pipeline that could give more insight into the issue.
    • Script Task Configuration: If the error is happening while running a script task, verify that the script task's configuration is correctly set up to reference the correct file path. Give these suggestions a shot, and you'll hopefully track down the issue. If the problem persists, feel free to share more about your setup, and we can dive in deeper.

    I hope this advise helps with you query?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.