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

Error on automatic deployment to Bluemix #38

Open
Akhoy opened this issue Feb 18, 2017 · 5 comments
Open

Error on automatic deployment to Bluemix #38

Akhoy opened this issue Feb 18, 2017 · 5 comments

Comments

@Akhoy
Copy link

Akhoy commented Feb 18, 2017

I'm using the v2-typescript branch of fabric-boilerplate and deploying it to Bluemix. I ran npm run cf to get into the CF repository. Now, that I'm in the CF repository when I execute cd server && npm run deploy, it gives me the following error:

root@0e02eea94aac:/usr/src/app# cd server && npm run deploy
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~predeploy: [email protected]
npm info lifecycle [email protected]~deploy: [email protected]

> [email protected] deploy /usr/src/app/server
> node dist/deploy.js

module.js:471
    throw err;
    ^

Error: Cannot find module '../../resources/testData.json'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/src/app/server/dist/testdata/testData.js:10:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

npm info lifecycle [email protected]~deploy: Failed to exec deploy script
npm ERR! Linux 4.4.43-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] deploy: `node dist/deploy.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy script 'node dist/deploy.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node dist/deploy.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls server
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/server/npm-debug.log

I can't see testdata.json file in the resources folder. I'm following the instruction given in the new readme file. Please help me in figuring this out.

@arner
Copy link
Collaborator

arner commented Feb 18, 2017

Hi Akhoy,

That's strange, it should be there:
https://github.com/IBM-Blockchain/fabric-boilerplate/tree/v2-typescript/server/resources

Could you share the contents of your resources directory? Is the file only not there in the container or also in your filesystem?

@Akhoy
Copy link
Author

Akhoy commented Feb 18, 2017

Hi arner,

I'm pretty sure the file's not there only in the container since I haven't started deploying from the filesystem. I'm pretty new to all this so I'm kinda finding my way around.

These are the commands I ran as per the documentation:

API endpoint:   https://api.eu-gb.bluemix.net (API version: 2.54.0)
User:           *******
No org or space targeted, use 'cf target -o ORG -s SPACE'
root@0e02eea94aac:/usr/src/app# cd server
root@0e02eea94aac:/usr/src/app/server# npm run deploy
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
/* error here */
root@0e02eea94aac:/usr/src/app/server# ls
Dockerfile  gruntfile.js  npm-debug.log  resources  test           tslint.json
dist        node_modules  package.json   src        tsconfig.json
root@0e02eea94aac:/usr/src/app/server# cd resources
root@0e02eea94aac:/usr/src/app/server/resources# ls
root@0e02eea94aac:/usr/src/app/server/resources# cd ../
root@0e02eea94aac:/usr/src/app/server# cd src
root@0e02eea94aac:/usr/src/app/server/src# ls
api  app.ts  auth  blockchain  config.ts  deploy.ts  entities  middleware  routes.ts  testChaincode.ts  testdata  utils
root@0e02eea94aac:/usr/src/app/server/src# cd ../
root@0e02eea94aac:/usr/src/app/server# cd dist
root@0e02eea94aac:/usr/src/app/server/dist# ls
api         auth        config.js.map  entities       routes.js         testChaincode.js.map
app.js      blockchain  deploy.js      middleware     routes.js.map     testdata
app.js.map  config.js   deploy.js.map  npm-debug.log  testChaincode.js  utils
root@0e02eea94aac:/usr/src/app/server/dist# 
/* error comes here when i run deploy.js since the resources folder is blank */

@arner
Copy link
Collaborator

arner commented Feb 18, 2017

Thanks. You could try to do docker build so it rebuilds the container. I don't know why the file didn't get copied correctly...

@Akhoy
Copy link
Author

Akhoy commented Feb 19, 2017

I tried building it and running again but the same issue persists. The files under resources are not getting copied... I'm running docker build --tag cf --no-cache=true . && docker run -it --rm -v $(pwd)/server/resources:/usr/src/app/server/resources cf directly since I get an error in the docker engine when I run npm run cf. Is it the same?

BTW, I'm getting this error with npm run cf

G:\fabric-boilerplate-2-typescript>docker run -it --rm -v $(pwd)/server/resources:/usr/src/app/server/resources cf
time="2017-02-18T21:45:17+05:30" level=warning msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
docker: Error response from daemon: create $(pwd)/server/resources: "$(pwd)/server/resources" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host directory, use absolute path.
See 'docker run --help'.

When I run the cf command in docker directly, it works.

@Akhoy
Copy link
Author

Akhoy commented Feb 19, 2017

I removed the mount command -v and ran it directly like docker run -it --rm. The resources folder got copied correctly this time. But now, I'm getting a failed to register WebAppAdmin error. The error is just blank. Any help on this is much appreciated!

info: [SDK] Running in bluemix mode
info: [SDK] Connected to memberservice and peer
error: [SDK] Failed to register WebAppAdmin, Error
error:

npm info lifecycle [email protected]~deploy: Failed to exec deploy script
npm ERR! Linux 4.4.43-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] deploy: `node dist/deploy.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy script 'node dist/deploy.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node dist/deploy.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls server
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/server/npm-debug.log
root@c2a29be0aae0:/usr/src/app/server#

This is the full log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'deploy' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle [email protected]~predeploy: [email protected]
6 silly lifecycle [email protected]~predeploy: no script for predeploy, continuing
7 info lifecycle [email protected]~deploy: [email protected]
8 verbose lifecycle [email protected]~deploy: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~deploy: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/src/app/server/node_modules/.bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle [email protected]~deploy: CWD: /usr/src/app/server
11 silly lifecycle [email protected]~deploy: Args: [ '-c', 'node dist/deploy.js' ]
12 silly lifecycle [email protected]~deploy: Returned: code: 1  signal: null
13 info lifecycle [email protected]~deploy: Failed to exec deploy script
14 verbose stack Error: [email protected] deploy: `node dist/deploy.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /usr/src/app/server
17 error Linux 4.4.43-boot2docker
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
19 error node v6.9.1
20 error npm  v3.10.8
21 error code ELIFECYCLE
22 error [email protected] deploy: `node dist/deploy.js`
22 error Exit status 1
23 error Failed at the [email protected] deploy script 'node dist/deploy.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the server package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     node dist/deploy.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs server
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls server
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

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

No branches or pull requests

2 participants