Skip to content

ERROR: error executing step command 'package --all': failed building service 'backend': failed invoking event handlers for 'prebuild', 'prebuild' hook failed with exit code: '0' #2474

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

Open
fonsecabarros opened this issue Apr 2, 2025 · 5 comments
Labels

Comments

@fonsecabarros
Copy link

When I try to use the command azd up, it returns this error:

Packaging services (azd package)

(x) Failed: Packaging service backend

ERROR: error executing step command 'package --all': failed building service 'backend': failed invoking event handlers for 'prebuild', 'prebuild' hook failed with exit code: '0', Path: 'C:\Users\tbarros\AppData\Local\Temp\azd-prebuild-1333188587.ps1'. : executable file not found in %PATH%

Every time I try to provision and deploy, it generates a different .ps1 (temp) file. I tried to incorporate that into the Path with no success.

@pamelafox pamelafox added the azd label Apr 3, 2025
@pamelafox
Copy link
Collaborator

I've asked the azd team to take a look at this report, as I'm not sure what's going on.

@vhvb1989
Copy link
Contributor

vhvb1989 commented Apr 3, 2025

executable file not found in %PATH%

This means powershell 7 is not installed. AZD needs powershell7 to run ps1 hooks.

What azd version are you using? @fonsecabarros . The error from AZD should be describing the error and how to fix it in a better way since version 1.13.2

@fonsecabarros
Copy link
Author

The powershell was indeed not updated but even after updating it to the version 7.5, whenever I start provisioning the app, it gets stuck like the below without any progress.

Image

@vhvb1989
Copy link
Contributor

vhvb1989 commented Apr 3, 2025

The hook is running cd ../frontend;npm install;npm run build

You can manually try this in your side to see if something is blocking this. npm install typically takes a long time in Windows.

@fonsecabarros
Copy link
Author

After updating the powershell and running the npm install, it proceeded and got to the point where I was before. I'm working in a medium size company where I have Contributor access to most resources. However, for example, I can't create a resource group, I have access to one where I can manage these resources.

With that said, what happens is that when I try to run azd up, I have the following error message:

Image

I have changed the values in the main.parameters.json with all the resource groups and services I have already available and set and still doesn't allow me to proceed. Is there any way to deploy this rag chat without being an administrator? Should I get this answer anywhere else? I appreciate your help on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants