Cannot deploy Supply Chain Demo App


#1

Local Strato installation, running on Windows 10, Node v8.9.4, npm 5.6.0

Strato management dashboard runs fine on 192.168.99.100

I’m getting the following error (see below) when I try to deploy the Blockapss BA / supply chain demo.

I type at root of project in Docker the following:

set "SERVER=192.168.0.9" & npm run deploy-windows

Error: ENOENT: no such file or directory, open 'C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\server\config\%SERVER%.config.yaml'
        at Object.fs.openSync (fs.js:646:18)
        at Object.fs.readFileSync (fs.js:551:33)
        at getYamlFile (C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\node_modules\blockapps-rest\lib\config.js:11:29)
        at Object.<anonymous> (C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\node_modules\blockapps-rest\lib\config.js:28:20)
        at Module._compile (module.js:643:30)
        at Object.Module._extensions..js (module.js:654:10)
        at Module.load (module.js:556:32)
        at tryModuleLoad (module.js:499:12)
        at Function.Module._load (module.js:491:3)
        at Module.require (module.js:587:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\node_modules\blockapps-rest\lib\common.js:10:16)
        at Module._compile (module.js:643:30)
        at Object.Module._extensions..js (module.js:654:10)
        at Module.load (module.js:556:32)
        at tryModuleLoad (module.js:499:12)
        at Function.Module._load (module.js:491:3)
        at Module.require (module.js:587:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\node_modules\blockapps-rest\lib\rest_4.js:1:78)
        at Module._compile (module.js:643:30)
        at Object.Module._extensions..js (module.js:654:10)
        at Module.load (module.js:556:32)
        at tryModuleLoad (module.js:499:12)
        at Function.Module._load (module.js:491:3)
        at Module.require (module.js:587:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\node_modules\blockapps-rest\index.js:1:76)
        at Module._compile (module.js:643:30)
        at Object.Module._extensions..js (module.js:654:10)
        at Module.load (module.js:556:32)
        at tryModuleLoad (module.js:499:12)
        at Function.Module._load (module.js:491:3)
        at Module.require (module.js:587:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (C:\dropboxfolders\pablosaban\dropbox\github\blockapps-ba\server\dapp\dapp.deploy.js:2:12)
        at Module._compile (module.js:643:30)
        at Object.Module._extensions..js (module.js:654:10)
        at Module.load (module.js:556:32)
        at tryModuleLoad (module.js:499:12)
        at Function.Module._load (module.js:491:3)
        at Module.require (module.js:587:17)
        at require (internal/module.js:11:18)
        at C:\Dropboxfolders\PabloSaban\Dropbox\GitHub\blockapps-ba\node_modules\mocha\lib\mocha.js:231:27
        at Array.forEach (<anonymous>)
        at Mocha.loadFiles (C:\Dropboxfolders\PabloSaban\Dropbox\GitHub\blockapps-ba\node_modules\mocha\lib\mocha.js:228:14)
        at Mocha.run (C:\Dropboxfolders\PabloSaban\Dropbox\GitHub\blockapps-ba\node_modules\mocha\lib\mocha.js:514:10)
        at Object.<anonymous> (C:\Dropboxfolders\PabloSaban\Dropbox\GitHub\blockapps-ba\node_modules\mocha\bin\_mocha:480:18)
        at Module._compile (module.js:643:30)
        at Object.Module._extensions..js (module.js:654:10)
        at Module.load (module.js:556:32)
        at tryModuleLoad (module.js:499:12)
        at Function.Module._load (module.js:491:3)
        at Function.Module.runMain (module.js:684:10)
        at startup (bootstrap_node.js:187:16)
        at bootstrap_node.js:608:3
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] deploy-windows: `mocha server/dapp/dapp.deploy.js --config server/config/%SERVER%.config.yaml -b`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] deploy-windows script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\psaba\AppData\Roaming\npm-cache\_logs\2018-01-05T04_49_24_756Z-debug.log
    [1]+  Done                    set "SERVER=default"

Any help is appreciated.


#2

Hi!
Windows commands in BlockApps-BA docs are assumed to be run in Windows command prompt, not in Docker terminal (which is the Linux environment).
To deploy and run the BlockApps-BA in Docker terminal, use the Linux syntax:
SERVER=<server-name> npm run deploy
where <server-name> is the name of the pre-created config file (see Deployment section in readme: https://github.com/blockapps/blockapps-ba/blob/master/README.md#user-content-deployment )


#3

UPDATE: I did a fresh install of SMD node, etc and then ran through the deploy of supply chain demo app. Looks like I have installed successfully (kind of).

Running:
set "REACT_APP_API_URL=192.168.10.105" & set "PORT=3030" & npm run start-windows
launches a browser pointing to 192.168.105:3030/login.

But if I try to login using one of the accounts created during the deploy such as Buyer1 with password 1234 a red progress bar runs just below the blue logo header, but stops shy of completing. Seems to lock up and does not actually log me in.

Again any help is appreciated.

Also a log file from chrome developer tools console:

    utils.js:235 submitLogin has been cancelled 
    login.saga.js:29 POST http://localhost:3030/192.168.10.105/api/v1/login 404 (Not Found)
    loginApiCall @ login.saga.js:29
    runCallEffect @ proc.js:506
    runEffect @ proc.js:434
    next @ proc.js:315
    currCb @ proc.js:388
    (anonymous) @ proc.js:492
    exec @ scheduler.js:28
    flush @ scheduler.js:69
    asap @ scheduler.js:42
    (anonymous) @ channel.js:189
    emit @ channel.js:40
    (anonymous) @ middleware.js:87
    (anonymous) @ bindActionCreators.js:7
    Login._this.submit @ index.js:18
    doSubmit @ handleSubmit.js:39
    handleSubmit @ handleSubmit.js:101
    (anonymous) @ createReduxForm.js:583
    (anonymous) @ silenceEvents.js:19
    ReactErrorUtils.invokeGuardedCallback @ ReactErrorUtils.js:69
    executeDispatch @ EventPluginUtils.js:85
    executeDispatchesInOrder @ EventPluginUtils.js:108
    executeDispatchesAndRelease @ EventPluginHub.js:43
    executeDispatchesAndReleaseTopLevel @ EventPluginHub.js:54
    forEachAccumulated @ forEachAccumulated.js:24
    processEventQueue @ EventPluginHub.js:257
    runEventQueueInBatch @ ReactEventEmitterMixin.js:17
    handleTopLevel @ ReactEventEmitterMixin.js:28
    handleTopLevelImpl @ ReactEventListener.js:72
    perform @ Transaction.js:140
    batchedUpdates @ ReactDefaultBatchingStrategy.js:62
    batchedUpdates @ ReactUpdates.js:97
    dispatchEvent @ ReactEventListener.js:147
    apiErrorHandler.js:5 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
        at Object.parse (<anonymous>)
        at apiErrorHandler.js:5
        at <anonymous>
    (anonymous) @ apiErrorHandler.js:5
    Promise resolved (async)
    (anonymous) @ apiErrorHandler.js:4
    handleApiError @ apiErrorHandler.js:2
    Promise resolved (async)
    loginApiCall @ login.saga.js:29
    runCallEffect @ proc.js:506
    runEffect @ proc.js:434
    next @ proc.js:315
    currCb @ proc.js:388
    (anonymous) @ proc.js:492
    exec @ scheduler.js:28
    flush @ scheduler.js:69
    asap @ scheduler.js:42
    (anonymous) @ channel.js:189
    emit @ channel.js:40
    (anonymous) @ middleware.js:87
    (anonymous) @ bindActionCreators.js:7
    Login._this.submit @ index.js:18
    doSubmit @ handleSubmit.js:39
    handleSubmit @ handleSubmit.js:101
    (anonymous) @ createReduxForm.js:583
    (anonymous) @ silenceEvents.js:19
    ReactErrorUtils.invokeGuardedCallback @ ReactErrorUtils.js:69
    executeDispatch @ EventPluginUtils.js:85
    executeDispatchesInOrder @ EventPluginUtils.js:108
    executeDispatchesAndRelease @ EventPluginHub.js:43
    executeDispatchesAndReleaseTopLevel @ EventPluginHub.js:54
    forEachAccumulated @ forEachAccumulated.js:24
    processEventQueue @ EventPluginHub.js:257
    runEventQueueInBatch @ ReactEventEmitterMixin.js:17
    handleTopLevel @ ReactEventEmitterMixin.js:28
    handleTopLevelImpl @ ReactEventListener.js:72
    perform @ Transaction.js:140
    batchedUpdates @ ReactDefaultBatchingStrategy.js:62
    batchedUpdates @ ReactUpdates.js:97
    dispatchEvent @ ReactEventListener.js:147

Nikita,

Thanks for your help. Running at windows cmd prompt made progress, but I’m still running into errors. After installing dependencies (at windows cmd prompt) as indicated in the deployment guide (npm i) in both root and ui directories I enter the following:

set "SERVER=192" & npm run deploy-windows

Below is the abbreviated output and the contents of my 192.config.yaml file

FYI, I’ve configured the 192.config.yaml to use nodes id: 0 with http://192.168.99.100. This is the only change I made to the file

Any help is appreciated.

   " -d "args={}" -d "contract=AdminInterface" -d "txParams={gasLimit:100000000,gasPrice:1}"  http://192.168.99.100/bloc/v2.2/users/Admin_5960_76819/4ba1ef49661ca8202645053de823337b948d3266/contract?resolve
    1) should upload the contracts


  0 passing (6s)
  1 failing

  1) Supply Chain Demo App - deploy contracts should upload the contracts:
     HttpError: 400 Bad Request: "strato error: failed to find account": http://192.168.99.100/bloc/v2.2/users/Admin_5960_76819/4ba1ef49661ca8202645053de823337b948d3266/contract?resolve
      at node_modules\blockapps-rest\lib\rest_4.js:260:40
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)



npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy-windows: `mocha server/dapp/dapp.deploy.js --config server/config/%SERVER%.config.yaml -b`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy-windows script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\psaba\AppData\Roaming\npm-cache\_logs\2018-01-09T13_42_49_320Z-debug.log
  1) Suply Chain Demo App - deploy contracts should upload the contracts:
     Error: connect ETIMEDOUT 192.168.0.106:80
      at Object._errnoException (util.js:1022:11)
      at _exceptionWithHostPort (util.js:1044:20)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)



npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy-windows: `mocha server/dapp/dapp.deploy.js --config server/config/%SERVER%.config.yaml -b`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy-windows script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\psaba\AppData\Roaming\npm-cache\_logs\2018-01-09T13_29_59_308Z-debug.log

************************** Contents of my 192.config.yaml ***********************************

apiDebug: true
password: '1234'
timeout: 600000
libPath: ./server/lib
dataFilename: ./server/dapp/dapp.presets.yaml
deployFilename: ./server/config/192.deploy.yaml

# WARNING - extra strict syntax
# DO NOT change the nodes order
# node 0 is the default url for all single node api calls
nodes:
  - id: 0
    explorerUrl: 'http://192.168.99.100:9000'
    stratoUrl: 'http://192.168.99.100/strato-api'
    blocUrl: 'http://192.168.99.100/bloc/v2.2'
    searchUrl: 'http://192.168.99.100/cirrus'