Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

npm ERR! Unsupported URL Type "workspace:": workspace:*

Open dawwa opened this issue 2 years ago • 3 comments

Bug Report

Trying to deploy this app to Azure Web App Service - Linux https://github.com/microsoft/BotFramework-Composer/tree/master/Composer

Deployment can go through before setting SCM_DO_BUILD_DURING_DEPLOYMENT=true After setting the configure to true, build is triggered during deployment, and surface this problem.

related document about the subject project https://docs.microsoft.com/en-us/composer/how-to-host-composer

  • How can we reproduce it?
  1. Prepare a Linux Azure Web App resource in Azure,
  2. Clone this repo git clone https://github.com/microsoft/BotFramework-Composer.git
  3. Set the Build during deployment for the web app az webapp config appsettings set --subscription "xxxxx" --resource-group "xxxx" --name "xxxx" --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true
  4. CD into the Composer directory and from there run the az webapp up command to start deployment. az webapp up --os-type "Windows" --subscription "xxxxx" --resource-group "xxxxx" --plan "xxxxx" --name "xxxxx"
  • Do you have log output? Please include between the backticks: Log from Deployment Center of Azure Web App Service
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 14 -i /tmp/8da7c1490e0d2aa -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log  | tee /tmp/oryx-build.log
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220308.4, Commit: c92fa6a2d6fc14dc9646f80e2bb2e393a5cdc258, ReleaseTagName: 20220308.4

Build Operation ID: |PnCTze0qD9I=.3042efab_
Repository Commit : 5d00bfc4-171d-4c1e-9a0f-36255375ea16

Detecting platforms...
Detected following platforms:
  nodejs: 14.19.1
Version '14.19.1' of platform 'nodejs' is not installed. Generating script to install it...

Using intermediate directory '/tmp/8da7c1490e0d2aa'.

Copying files to the intermediate directory...
Done in 1 sec(s).

Source directory     : /tmp/8da7c1490e0d2aa
Destination directory: /home/site/wwwroot


Downloading and extracting 'nodejs' version '14.19.1' to '/tmp/oryx/platforms/nodejs/14.19.1'...
Downloaded in 0 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: nodejs...
Done in 3 sec(s).

Removing existing manifest file
Creating directory for command manifest file if it doesnot exist
Creating a manifest file...
Node Build Command Manifest file created.

Using Node version:
v14.19.1

Using Npm version:
6.14.16

Running 'npm install --unsafe-perm'...

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2022-08-12T03_41_48_144Z-debug.log
npm ERR! code EUNSUPPORTEDPROTOCOL\nnpm ERR! Unsupported URL Type "workspace:": workspace:*\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/.npm/_logs/2022-08-12T03_41_48_144Z-debug.log\n/bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 14 -i /tmp/8da7c1490e0d2aa -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log  | tee /tmp/oryx-build.log ; exit $PIPESTATUS "

Content of the sample log: 2022-08-12T03_41_48_144Z-debug.log

/home/.npm/_logs>cat 2022-08-12T03_41_48_144Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/tmp/oryx/platforms/nodejs/14.19.1/bin/node',
1 verbose cli   '/tmp/oryx/platforms/nodejs/14.19.1/bin/npm',
1 verbose cli   'install',
1 verbose cli   '--unsafe-perm'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 8119997ea70a7e2d
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall @bfc/root@
7 info lifecycle @bfc/root@~preinstall: @bfc/root@
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 18ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 5ms
16 silly install loadAllDepsIntoIdealTree
17 timing stage:rollbackFailedOptional Completed in 0ms
18 timing stage:runTopLevelLifecycles Completed in 91ms
19 silly saveTree @bfc/root@
20 verbose stack Error: Unsupported URL Type "workspace:": workspace:*
20 verbose stack     at unsupportedURLType (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:200:15)
20 verbose stack     at fromURL (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:258:13)
20 verbose stack     at Function.resolve (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:77:12)
20 verbose stack     at /tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/lib/install/deps.js:493:20
20 verbose stack     at Array.map (<anonymous>)
20 verbose stack     at /tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/lib/install/deps.js:492:47
20 verbose stack     at tryCatcher (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
20 verbose stack     at Promise._settlePromiseFromHandler (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
20 verbose stack     at Promise._settlePromise (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
20 verbose stack     at Promise._settlePromiseCtx (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:611:10)
20 verbose stack     at _drainQueueStep (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12)
20 verbose stack     at _drainQueue (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
20 verbose stack     at Async._drainQueues (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
20 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (/tmp/oryx/platforms/nodejs/14.19.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
20 verbose stack     at processImmediate (internal/timers.js:464:21)
21 verbose cwd /tmp/8da7c1490e0d2aa
22 verbose Linux 5.4.0-1074-azure
23 verbose argv "/tmp/oryx/platforms/nodejs/14.19.1/bin/node" "/tmp/oryx/platforms/nodejs/14.19.1/bin/npm" "install" "--unsafe-perm"
24 verbose node v14.19.1
25 verbose npm  v6.14.16
26 error code EUNSUPPORTEDPROTOCOL
27 error Unsupported URL Type "workspace:": workspace:*
28 verbose exit [ 1, true ]
/home/.npm/_logs> 

dawwa avatar Aug 12 '22 04:08 dawwa

@dawwa Hey Dawei, apologies for the delayed response -- from digging around a little, it appears this issue is a result of the oryx build command generating the build script to include npm install rather than yarn install. I found this is because the Composer project within BotFramework-Composer doesn't include a yarn.lock file or explicitly call out a yarn version to install in the package.json file (with the engines.yarn property). The project does have a yarn-berry.lock file, which I renamed to just yarn.lock to allow Oryx to successfully identify it as a Yarn application and mitigate the exception you're seeing above; however, I do run into another exception:

error An unexpected error occurred: "https://registry.yarnpkg.com/@bfc%2feslint-plugin-bfcomposer: Not found".

I don't have context as to where this @bfc/eslint-plugin-bfcomposer package is published or if it should exist on the Yarn registry, but I'm hoping this is something that you may be able to tackle 🙂 If there's anything additional that you require from me, please let me know!

cormacpayne avatar Aug 17 '22 22:08 cormacpayne

thanks @cormacpayne, the error you saw seems to be these https://github.com/microsoft/BotFramework-Composer/issues/5478 https://github.com/microsoft/BotFramework-Composer/issues/3945

does the reply from bot framework team ring some bells around oryx's file operations?

dawwa avatar Aug 18 '22 07:08 dawwa

You may try to use yarn command with -W flag instead of npm command that might be helpfule Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check). info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

myakhlaqi avatar Aug 20 '22 17:08 myakhlaqi

This issue seems resolved. Will be closing this issue. If this is still relevant and impacting you please open a new issue and link back to this issue for reference.

simonjj avatar Jan 11 '24 22:01 simonjj