azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '.\Temp\azd-prepackage-3804030346.ps1'. : exit code: 1

Open ApurvaL opened this issue 2 years ago • 4 comments
trafficstars

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azd auth login azd up

Any log messages given by the failure

error: Cannot find module '.\typescript\bin\tsc' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v18.16.0 (x) Failed: Packaging service backend

ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '.\Temp\azd-prepackage-3804030346.ps1'. : exit code: 1

Expected/desired behavior

OS and Version?

Windows 11

azd version?

azd version 1.0.1

Versions

Mention any other details that might be useful

Installed node.js 18.16 and power shell 7.3 and selected location East US. already tried uninstalling and reinstalling node.js multiple times.

ApurvaL avatar Jun 09 '23 12:06 ApurvaL

I am getting the same error as well on Win 11 22H2,

Error: Cannot find module 'C:\Users\USER\typescript\bin\tsc'

RbrtsMlkn avatar Jun 09 '23 13:06 RbrtsMlkn

I'm getting the same error as @ApurvaL

Earlier in the output, it also shows this for me - not sure if it is related or a separate issue:

npm ERR! code EPROTO
npm ERR! syscall write
npm ERR! errno EPROTO
npm ERR! request to https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz failed, reason: write EPROTO CC1D0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:c:\ws\deps\openssl\openssl\ssl\statem\extensions.c:922:

Codearella avatar Jun 12 '23 19:06 Codearella

This looks like the result of a corrupted npm install, leading to the missing tsc dependency.

Try deleting the folder node_modules and package-lock.json from app/frontend and then run azd up again

vhvb1989 avatar Jun 12 '23 20:06 vhvb1989

This looks like the result of a corrupted npm install, leading to the missing tsc dependency.

Try deleting the folder node_modules and package-lock.json from app/frontend and then run azd up again

Clearing this did not fix it for me, however upon running the command again I noticed further up it was referencing a broken path. The onedrive folder I was running from contains a '&' in the path causing it to break. Moving the folder to C:\Temp allowed me to get past the issue.

` |==== | Packaging service backend'BROKENPATH\Desktop\newerAI\app\frontend\node_modules.bin' is not recognized as an internal or external command, operable program or batch file. node:internal/modules/cjs/loader:1078 throw err; ^

Error: Cannot find module 'C:\Users\USER\typescript\bin\tsc' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

`

RbrtsMlkn avatar Jun 12 '23 21:06 RbrtsMlkn

I'm having the same problem and I can't solve it. Please help me. For reference, is it because I can't receive yallist-3.1.1.tgz files in a situation where I can't connect to the external network? So, can I download the file and install it in the closed network?

npm ERR! code EPROTO npm ERR! syscall write npm ERR! errno EPROTO

npm ERR! request to https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz failed, reason: write EPROTO 7C220000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:c:\ws\deps\openssl\openssl\ssl\statem\extensions.c:922:

npm ERR!

npm ERR! A complete log of this run can be found in: C:\Users\1903436\AppData\Local\npm-cache_logs\2023-08-16T10_40_18_712Z-debug-0.log

|===== | Packaging service backend

[email protected] build

tsc && vite build

'tsc' is not recognized as an internal or external command,

operable program or batch file.

(x) Failed: Packaging service backend

ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: 'C:\Users\1903436\AppData\Local\Temp\azd-prepackage-2122447558.ps1'. : exit code: 1

hello-lui avatar Aug 16 '23 11:08 hello-lui

@hello-lui If you are on a closed network that can't download packages from the web, then you will likely have a hard time deploying this app, since it has to download both npm packages and Python packages. How do you typically get dependencies for apps? Here are some ideas about doing that for npm: https://stackoverflow.com/questions/43064107/how-to-install-npm-package-while-offline

You can also open this in GitHub Codespaces and do the deployment from there, if you're unable to do it locally.

pamelafox avatar Aug 16 '23 23:08 pamelafox

@pamelafox Thank you As suggested, I solved it by copying the entire '/app' directory after deploying on a computer with the same settings but internet access!!!

Have a nice day!

hello-lui avatar Aug 17 '23 06:08 hello-lui

@pamelafox

hello. After solving the nmp package problem in the closed network, a problem occurred that the python package was not installed this time as shown below. T.T

I've already downloaded all the package files from the open network, but I don't know where to upload them. can i solve this problem?


(✓) Done: Storage account: stg3ru74brjxdo2 (✓) Done: Azure OpenAI: cog-g3ru74brjxdo2 (✓) Done: Search service: gptkb-g3ru74brjxdo2 (✓) Done: App Service: app-backend-g3ru74brjxdo2

Executing postprovision hook => .\scripts\prepdocs.ps1 Loading azd .env file from current environment

Environment variables set. Creating python virtual environment "scripts/.venv" Installing dependencies from "requirements.txt" into virtual environment

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))': /simple/pypdf/

WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))': /simple/pypdf/

WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))': /simple/pypdf/

WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))': /simple/pypdf/

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))': /simple/pypdf/

Could not fetch URL https://pypi.org/simple/pypdf/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pypdf/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))) - skipping

ERROR: Could not find a version that satisfies the requirement pypdf==3.9.0 (from versions: none)

ERROR: No matching distribution found for pypdf==3.9.0

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)'))) - skipping

Running "prepdocs.py"

Traceback (most recent call last):

File "C:\Temp\RG_Test_GPT_with_Data_public\scripts\prepdocs.py", line 10, in

import openai

ModuleNotFoundError: No module named 'openai'

Deploying services (azd deploy)

(✓) Done: Deploying service backend

hello-lui avatar Aug 17 '23 09:08 hello-lui

Great! I'm going to close this issue as I don't see any pending issues for us to fix on this repo, please comment if you think there is still something for us to fix.

pamelafox avatar Aug 17 '23 21:08 pamelafox