Error Building ThingsBoard From Source - Thingsboard Server UI FAILURE - node.js

I want to generate the Thingsboard dependency jars, which I want to use in my application to call Thingsboard API's from my java application.
To use Thingsboard dependency jars, I have to build the application as these jars not available in a public repository.
I am trying to build ThingsBoard application from source, I am following the instructions mentioned in
link - https://thingsboard.io/docs/user-guide/install/building-from-source/
I clone the ThingsBoard report and then checked out "release-1.4" branch and ran the mvn clean install command.
The application build is failing with below mentioned error.
[INFO] Installing npm version 3.10.8
[INFO] Unpacking /var/root/.m2/repository/com/github/eirslett/npm/3.10.8/npm-3.10.8.tar.gz into /Users/admin/workspaces/IOT/ThingsBoard/source/thingsboard/ui/target/node/node_modules
[INFO] Installed npm locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.0:npm (npm install) # ui ---
[INFO] Running 'npm install' in /Users/admin/workspaces/IOT/ThingsBoard/source/thingsboard/ui
[WARNING] npm WARN deprecated angular-ui-router#0.3.2: This npm package 'angular-ui-router' has been renamed to '#uirouter/angularjs'. Please update your package.json. See https://ui-router.github.io/blog/uirouter-scoped-packages/
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/fabiobiondi/angular-fullscreen.git /Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489: Cloning into bare repository '/Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489'...
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/fabiobiondi/angular-fullscreen.git /Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489: fatal: unable to connect to github.com:
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/fabiobiondi/angular-fullscreen.git /Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489: github.com[0: 192.30.253.113]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/fabiobiondi/angular-fullscreen.git /Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489: github.com[1: 192.30.253.112]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/thingsboard/flot.git /Users/admin/.npm/_git-remotes/git-github-com-thingsboard-flot-git-0-9-work-799e39f1: Cloning into bare repository '/Users/admin/.npm/_git-remotes/git-github-com-thingsboard-flot-git-0-9-work-799e39f1'...
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/thingsboard/flot.git /Users/admin/.npm/_git-remotes/git-github-com-thingsboard-flot-git-0-9-work-799e39f1: fatal: unable to connect to github.com:
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/thingsboard/flot.git /Users/admin/.npm/_git-remotes/git-github-com-thingsboard-flot-git-0-9-work-799e39f1: github.com[0: 192.30.253.113]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/thingsboard/flot.git /Users/admin/.npm/_git-remotes/git-github-com-thingsboard-flot-git-0-9-work-799e39f1: github.com[1: 192.30.253.112]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/MichaelZinsmaier/CurvedLines.git /Users/admin/.npm/_git-remotes/git-github-com-MichaelZinsmaier-CurvedLines-git-master-843e4689: Cloning into bare repository '/Users/admin/.npm/_git-remotes/git-github-com-MichaelZinsmaier-CurvedLines-git-master-843e4689'...
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/MichaelZinsmaier/CurvedLines.git /Users/admin/.npm/_git-remotes/git-github-com-MichaelZinsmaier-CurvedLines-git-master-843e4689: fatal: unable to connect to github.com:
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/MichaelZinsmaier/CurvedLines.git /Users/admin/.npm/_git-remotes/git-github-com-MichaelZinsmaier-CurvedLines-git-master-843e4689: github.com[0: 192.30.253.113]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/MichaelZinsmaier/CurvedLines.git /Users/admin/.npm/_git-remotes/git-github-com-MichaelZinsmaier-CurvedLines-git-master-843e4689: github.com[1: 192.30.253.112]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/alenaksu/mdPickers.git /Users/admin/.npm/_git-remotes/git-github-com-alenaksu-mdPickers-git-0-7-5-ca6ad268: Cloning into bare repository '/Users/admin/.npm/_git-remotes/git-github-com-alenaksu-mdPickers-git-0-7-5-ca6ad268'...
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/alenaksu/mdPickers.git /Users/admin/.npm/_git-remotes/git-github-com-alenaksu-mdPickers-git-0-7-5-ca6ad268: fatal: unable to connect to github.com:
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/alenaksu/mdPickers.git /Users/admin/.npm/_git-remotes/git-github-com-alenaksu-mdPickers-git-0-7-5-ca6ad268: github.com[0: 192.30.253.113]: errno=Operation timed out
[ERROR] npm ERR! git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/alenaksu/mdPickers.git /Users/admin/.npm/_git-remotes/git-github-com-alenaksu-mdPickers-git-0-7-5-ca6ad268: github.com[1: 192.30.253.112]: errno=Operation timed out
[ERROR] npm ERR! Darwin 16.7.0
[ERROR] npm ERR! argv "/Users/admin/workspaces/IOT/ThingsBoard/source/thingsboard/ui/target/node/node" "/Users/admin/workspaces/IOT/ThingsBoard/source/thingsboard/ui/target/node/node_modules/npm/bin/npm-cli.js" "install"
[ERROR] npm ERR! node v6.9.1
[ERROR] npm ERR! npm v3.10.8
[ERROR] npm ERR! code 128
[ERROR]
[ERROR] npm ERR! Command failed: git clone --template=/Users/admin/.npm/_git-remotes/_templates --mirror git://github.com/fabiobiondi/angular-fullscreen.git /Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489
[ERROR] npm ERR! Cloning into bare repository '/Users/admin/.npm/_git-remotes/git-github-com-fabiobiondi-angular-fullscreen-git-master-2346b489'...
[ERROR] npm ERR! fatal: unable to connect to github.com:
[ERROR] npm ERR! github.com[0: 192.30.253.113]: errno=Operation timed out
[ERROR] npm ERR! github.com[1: 192.30.253.112]: errno=Operation timed out
---
---
[INFO] Thingsboard ........................................ SUCCESS [ 1.895 s]
[INFO] Thingsboard Server Commons ......................... SUCCESS [ 0.070 s]
[INFO] Thingsboard Server Common Data ..................... SUCCESS [ 4.105 s]
[INFO] Thingsboard Server Common Messages ................. SUCCESS [ 0.716 s]
[INFO] Thingsboard Server Common Transport components ..... SUCCESS [ 0.739 s]
[INFO] Thingsboard Server DAO Layer ....................... SUCCESS [ 8.202 s]
[INFO] Thingsboard Server Extensions API .................. SUCCESS [ 1.109 s]
[INFO] Thingsboard Server Core Extensions ................. SUCCESS [ 4.167 s]
[INFO] Thingsboard Extensions ............................. SUCCESS [ 0.054 s]
[INFO] Thingsboard Server RabbitMQ Extension .............. SUCCESS [ 1.810 s]
[INFO] Thingsboard Server REST API Call Extension ......... SUCCESS [ 0.704 s]
[INFO] Thingsboard Server Kafka Extension ................. SUCCESS [ 2.283 s]
[INFO] Thingsboard Server MQTT Extension .................. SUCCESS [ 0.536 s]
[INFO] Thingsboard Server SQS Extension ................... SUCCESS [ 3.292 s]
[INFO] Thingsboard Server SNS Extension ................... SUCCESS [ 1.418 s]
[INFO] Thingsboard Server Transport Modules ............... SUCCESS [ 0.028 s]
[INFO] Thingsboard HTTP Transport ......................... SUCCESS [ 0.511 s]
[INFO] Thingsboard COAP Transport ......................... SUCCESS [ 1.111 s]
[INFO] Thingsboard MQTT Transport ......................... SUCCESS [ 0.711 s]
[INFO] Thingsboard Server UI .............................. FAILURE [02:53 min]
[INFO] Thingsboard Server Tools ........................... SKIPPED
[INFO] ThingsBoard Server Application ..................... SKIPPED
Any help is highly appreciated.

I solved issue in few steps
1. Restart System, so that it can close if in use.
2. Open command prompt with admin previleges
3. Run mvn clean install -DskipTests
Make sure you have java 8 , maven 3.0 + & git installed.
if still issue is there then remove node/npm from system the repeat all the points.

Based on your logs you obviously had issues to connect to github.com. Maybe some temporary issues. Try to rebuild. If not - try to clean ui/node_modules folder and rebuild again.

Related

NPM - Node error when building Angular App ELIFECYCLE - errno 139 after installing angular cli

Today i installed angular-cli, i had an issue where i couldn't install it at first because of missing permissions, later i installed it with sudo npm install, that caused me problems which i couldn't fix whole day today so im forced to ask this question here..
When i build frontend part of my application i get this error:
[INFO] > node ./node_modules/#angular/cli/bin/ng build --prod
[INFO]
[INFO] Segmentation fault (core dumped)
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 139
[INFO] npm ERR! app-fe#1.2.0 mavenbuild: `node ./node_modules/#angular/cli/bin/ng build --prod`
[INFO] npm ERR! Exit status 139
[INFO] npm ERR!
[INFO] npm ERR! Failed at the app-fe#1.2.0 mavenbuild script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO]
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR! /home/nikola/.npm/_logs/2020-07-10T16_08_21_554Z-debug.log
What's important to mention is that i could build my application successfully today before i installed angular-cli. No changes are made in the application, other people from my team can build it but i cant due to these issues.
This is the whole log: https://pastebin.com/srAAQXmn
I saw a post which said that i mada a mistake when i used SUDO to install anything with npm but i cannot find any solution...

Host key verification failed. fatal: Could not read from remote repository. GitHub Pages

I am getting the error below when using "npm run deploy". This repo was cloned using https.
UPDATE: It seems to be working after this quick revision of the remote set-url. The repo wasn't cloned using the SSH option so the remote set-url required the appropriate "https://" instead. Have a great day!
I changed the "git remote set-url origin git#github.com!laurenwatkins!laurenwatkins.github.io"
to git remote set-url origin https://github.com/laurenwatkins/laurenwatkins.github.io.git
> saadpasta.github.io#0.1.0 deploy C:\Users\laurenwatkins\Software\developerFolio
> gh-pages -b master -d build
Cloning into 'node_modules\gh-pages\.cache\git#github.com!laurenwatkins!laurenwatkins.github.io'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! saadpasta.github.io#0.1.0 deploy: `gh-pages -b master -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the saadpasta.github.io#0.1.0 deploy 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\laurenwatkins\AppData\Roaming\npm-cache\_logs\2020-02-13T11_07_18_464Z-debug.log
UPDATE: It seems to be working after this quick revision of the remote set-url. The repo wasn't cloned using the SSH option so the remote set-url required the appropriate "https://" instead. Have a great day!
The following "git remote set-url origin was changed.
Previous URL(error): git#github.com!laurenwatkins!laurenwatkins.github.io"
Updated URL(working): git remote set-url origin https://github.com/laurenwatkins/laurenwatkins.github.io.git

ng build fails with "You are running version v8.11.3 of Node.js, which is not supported by Angular CLI 8.0+."

I tried to reproduce a spring/angular [tutorial][1], but I am not able to run the ng build command (by maven). I reinstalled the nodejs msi installer several times, but it still says that my nodes version is not supported. I am very new to angular and have no idea what to do here. I found a lot of related problems that could be solved by npm cache clean and npm update but it does not solve my problem
windows 10 (64bit)
me> npm -v
6.9.0
me>node -v
v10.16.3
[INFO] > ng build
[INFO]
[ERROR] You are running version v8.11.3 of Node.js, which is not supported by Angular CLI 8.0+.
[ERROR] The official Node.js version that is supported is 10.9 or greater.
[ERROR]
[ERROR] Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 3
[ERROR] npm ERR! frontend#0.0.0 build: `ng build`
[ERROR] npm ERR! Exit status 3
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the frontend#0.0.0 build script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR! C:\Users\example\AppData\Roaming\npm-cache\_logs\2019-10-18T18_24_53_469Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] example 1.0-SNAPSHOT ............................ SUCCESS [ 0.384 s]
[INFO] frontend ........................................... FAILURE [ 13.778 s]
[INFO] backend 1.0-SNAPSHOT ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.609 s
[INFO] Finished at: 2019-10-18T20:24:53+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm run build) on project frontend: Failed to run task: 'npm run bu
ild' failed. (error code 3) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :frontend
[1]: https://dzone.com/articles/building-a-web-app-using-spring-boot-angular-6-and
You are using maven-fronted-plugin to install and execute a local distribution of node/npm, not the globally installed regular binaries.
See https://github.com/eirslett/frontend-maven-plugin for the configuration of desired node version in the maven pom.xml file.

Which .ssh/known_hosts file is used by npm in Azure?

Running a npm install git+ssh://<git repo url> from the Kudu's console in an Azure App Service instance fails with following error:
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
People often solve this error by adding the host's key to the .ssh/known_hosts file. The problem is that the correct key is already there. If it wasn't there, git clone <git repo url> would fail with the same error, but it does not. It successfully clones the repository.
In order to debug the issue, I tried to set the SSH's log level to DEBUG3 via the ~/.ssh/config file but the output did not change (while with git clone, it prints the debug info).
So, because of that I suspect that the problem is that the SSH client used by npm in Azure does not take the ~/.ssh directory into account.
My question is, is this documented somewhere or is it bug? Do you have any idea in which component the bug is?
FTR, the full output is:
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85: Cloning into bare repository 'D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85'...
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85:
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85: Host key verification failed.
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85: fatal: Could not read from remote repository.
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85:
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85: Please make sure you have the correct access rights
npm ERR! git clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85: and the repository exists.
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "git+ssh://<git repo url>"
npm ERR! node v4.2.3
npm ERR! npm v3.5.1
npm ERR! code 128
npm ERR! Command failed: git -c core.longpaths=true clone --template=D:\local\AppData\npm-cache\_git-remotes\_templates --mirror <git repo url> D:\local\AppData\npm-cache\_git-remotes\git-ssh-<git repo url>-dc8c35134031285cb7109c3e32618e85
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\foo\npm-debug.log
Here's how SSH settings (config file, known hosts, public / private keys) seem to be handled on Azure App Service:
The default folder for SSH configuration is D:\home\.ssh. This is what SSH and Git in the Kudu Debug Console use.
When you trigger host key generation through https://your-site.scm.azurewebsites.net/sshkey?ensurePublicKey=1, it'll create the D:\home\.ssh folder and place a config file with StrictHostKeyChecking no into it (as well as the newly generated SSH key). This means that SSH run through the Debug Console will now auto-accept hostkeys.
npm on Azure App Service expects the SSH configuration in %USERPROFILE%. You can see that when you run npm in the Debug Console for the first time, it will create the empty folder %USERPROFILE%\.ssh.
For npm compatibility, Kudu's deployment script will copy the D:\home\.ssh folder to %USERPROFILE% (see issue / fix). This should be happening every time you deploy through the web app's local Git repository, through Github or any of the other deployment options that trigger Kudu.
In my experience, that copied .ssh folder in %USERPROFILE% will be removed again when scaling and when restarting the app.
What I think happened in my case was that while debugging a different npm/git/ssh issue, I restarted the web app. I then ended up with the host key verification issue when running npm install manually in the Debug Console.
So for me the problem was that my app service was deployed through Github and hence had a deployment key associated with it's repo on Github.
To be able to access my other private repos I needed to do the following.
Remove the deployment key.
Get the public key from https://[your-web-app].scm.azurewebsites.net/api/sshkey?ensurePublicKey=1
Add the key to my SSH keys in github.
After this npm would happily install my private repos.

Can't push my node.js app to Heroku

I can't seem to push my updated repository to Heroku. It worked before and the app is live right now on Heroku, but I can't push updates to it.
I've tried npm update, bower update, reinstalling Heroku-toolbelt, pushing while on a different network, pulling from heroku master, and force pushing to heroku master, git pull --rebase, npm cache clean, bower cache clean, uninstalling karma, updating npm on heroku and cleaning the cache on heroku.
I have multiple Heroku accounts which I manage with Heroku Accounts (https://github.com/ddollar/heroku-accounts) as well as multiple git accounts, but I made sure I was on the correct ones.
Here is the last few lines from the terminal before failing to push:
3530 verbose rebuildBundles 'npmconf',
3530 verbose rebuildBundles 'rimraf',
3530 verbose rebuildBundles 'which' ]
3531 info install phantomjs#1.9.7-5
3532 verbose unsafe-perm in lifecycle true
3533 info phantomjs#1.9.7-5 Failed to exec install script
3534 error phantomjs#1.9.7-5 install: `node install.js`
3534 error Exit status 1
3535 error Failed at the phantomjs#1.9.7-5 install script.
3535 error This is most likely a problem with the phantomjs package,
3535 error not with npm itself.
3535 error Tell the author that this fails on your system:
33535 error node install.js
3535 error You can get their info via:
3535 error npm owner ls phantomjs
3535 error There is likely additional logging output above.
3536 error System Linux 3.8.11-ec2
3537 error command "/tmp/build_4600dbd4-687a-4b9c-bf9a-71e3baf5a1c4/vendor/node/bin/node" "/tmp/build_4600dbd4-687a-4b9c-bf9a-71e3baf5a1c4/vendor/node/bin/npm" "rebuild"
3538 error cwd /tmp/build_4600dbd4-687a-4b9c-bf9a-71e3baf5a1c4
3539 error node -v v0.10.29
3540 error npm -v 1.4.14
3541 error code ELIFECYCLE
3542 verbose exit [ 1, true ]
! Push rejected, failed to compile Node.js app
To git#heroku.personal:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.personal:myapp.git'
Any help is appreciated. Thanks!
After I didn't get any answers here on StackOverflow, I posted my question on Heroku support.
The problem was coming from phantomjs, I removed it from my dependencies and moved it to devDependencies. After that, I purged my build cache using the heroku-repo plugin https://github.com/heroku/heroku-repo
Then I could push to Heroku again

Resources