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

server does not start if data.json is missing defaultPath #1610

Closed
a-b-r-o-w-n opened this issue Nov 20, 2019 · 1 comment
Closed

server does not start if data.json is missing defaultPath #1610

a-b-r-o-w-n opened this issue Nov 20, 2019 · 1 comment
Assignees
Labels
P0 Must Fix. Release-blocker Type: Bug Something isn't working

Comments

@a-b-r-o-w-n
Copy link
Contributor

The app needs to be more resilient against changes to the data.json structure. If there is an existing data.json, the app should migrate it to the newer version without breaking.

Steps to Repro

  1. create a data.json with this contents:
{
  "storageConnections": [
    {
      "id": "default",
      "name": "This PC",
      "type": "LocalDisk",
      "path": "<your home path>/Documents/Composer"
    }
  ],
  "recentBotProjects": []
}

(notice no defaultPath)
2. Start the app.

~/src/BotFramework-Composer/Composer (master) $ yarn startall
yarn run v1.13.0
$ concurrently --kill-others-on-fail "npm:runtime" "npm:start"
[start] npmnpm WARN lifecycle The node binary used for scripts is /var/folders/_9/5k2ch04j1fsgwnt81_b175n00000gn/T/yarn--1574270706842-0.43671951124321007/node but npm is using /Users/chriswhitten/.nvm/versions/node/v12.13.1/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
[start]  WARN lifecycle The node binary used for scripts is /var/folders/_9/5k2ch04j1fsgwnt81_b175n00000gn/T/yarn--1574270706842-0.43671951124321007/node but npm is using /Users/chriswhitten/.nvm/versions/node/v12.13.1/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
[start]
[start] > @bfc/root@ start /Users/chriswhitten/src/BotFramework-Composer/Composer
[start] > cross-env NODE_ENV=production PORT=3000 yarn start:server
[start]
[runtime]
[runtime] > @bfc/root@ runtime /Users/chriswhitten/src/BotFramework-Composer/Composer
[runtime] > cd ../BotProject/CSharp/ && dotnet build && dotnet run
[runtime]
$ yarn workspace @bfc/server start
$ node build/server.js
[start] internal/validators.js:112
[start]     throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
[start]     ^
[start]
[start] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
[start]     at validateString (internal/validators.js:112:11)
[start]     at Object.dirname (path.js:1129:5)
[start]     at PathHandler.dirname (/Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server/build/utility/path.js:27:31)
[start]     at StorageService.createFolderRecurively (/Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server/build/services/storage.js:148:57)
[start]     at /Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server/build/services/storage.js:109:22
[start]     at Array.forEach (<anonymous>)
[start]     at StorageService.ensureDefaultBotFoldersExist (/Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server/build/services/storage.js:108:37)
[start]     at new StorageService (/Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server/build/services/storage.js:153:14)
[start]     at Object.<anonymous> (/Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server/build/services/storage.js:156:17)
[start]     at Module._compile (internal/modules/cjs/loader.js:959:30) {
[start]   code: 'ERR_INVALID_ARG_TYPE'
[start] }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
[start] Exit code: 1
[start] Command: /Users/chriswhitten/.nvm/versions/node/v12.13.1/bin/node
[start] Arguments: /usr/local/lib/node_modules/yarn/lib/cli.js start
[start] Directory: /Users/chriswhitten/src/BotFramework-Composer/Composer/packages/server
[start] Output:
[start]
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[start] npm ERR! code ELIFECYCLE
[start] npm ERR! errno 1
[start] npm ERR! @bfc/root@ start: `cross-env NODE_ENV=production PORT=3000 yarn start:server`
[start] npm ERR! Exit status 1
[start] npm ERR!
npm ERR! Failed at the @bfc/root@ start script.
[start] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[start]
[start] npm ERR! A complete log of this run can be found in:
[start] npm ERR!     /Users/chriswhitten/.npm/_logs/2019-11-20T17_25_09_932Z-debug.log
[start] npm run start exited with code 1
--> Sending SIGTERM to other processes..
[runtime] npm run runtime exited with code SIGTERM
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@a-b-r-o-w-n a-b-r-o-w-n added Needs-triage A new issue that require triage P0 Must Fix. Release-blocker R7 Release 7 - December 10th, 2019 Type: Bug Something isn't working and removed Needs-triage A new issue that require triage labels Nov 20, 2019
@a-b-r-o-w-n
Copy link
Contributor Author

@liweitian We should also allow this to be configurable (for environments such as test, CI, etc). Please support COMPOSER_BOTS_FOLDER environment variable.

@cwhitten cwhitten removed the R7 Release 7 - December 10th, 2019 label Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 Must Fix. Release-blocker Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants