question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build Dashboard error

See original GitHub issue

hi,I encountered a problem when using Maven to build Dashboard in che 5.2.2

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (compile) on project che-dashboard-war: An Ant BuildException has occured: Replace: source file /home/user/source/dashboard/dist/index.html doesn’t exist [ERROR] around Ant part …<replace file="/home/user/source/dashboard/dist/index.html">… @ 7:63 in /home/user/source/dashboard/target/antrun/build-main.xml [ERROR] -> [Help 1]

I compare che5.2.2 and che5.0.1 versions of the dashboard pom.xml ,Find some change : v5.0.1:

                            <target>
                                <!-- Download NPM dependencies -->
                                <exec dir="${basedir}" executable="npm" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Typings dependencies -->
                                <exec dir="${basedir}" executable="typings" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Bower dependencies -->
                                <exec dir="${basedir}" executable="bower" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Build the application -->
                                <exec dir="${basedir}" executable="gulp" failonerror="true">
                                    <arg value="build" />
                                </exec>
                                <!-- Change base HREF of the application that will be hosted on /dashboard -->
                                <replace file="${basedir}/dist/index.html">
                                    <replacetoken><![CDATA[<base href="/">]]></replacetoken>
                                    <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
                                </replace>
                            </target>
                        </configuration>

v5.2.2:

 <configuration>
                            <target>
                                <!-- Download NPM dependencies -->
                                <exec dir="${basedir}" executable="npm" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Change base HREF of the application that will be hosted on /dashboard -->
                                <replace file="${basedir}/dist/index.html">
                                    <replacetoken><![CDATA[<base href="/">]]></replacetoken>
                                    <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
                                </replace>
                            </target>
                        </configuration>

I’m using a new machine (never built dashboard) ,I add code that has been deleted in che5.2.2 at dashboard pom.xml

   <!-- Download Typings dependencies -->
                                <exec dir="${basedir}" executable="typings" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Bower dependencies -->
                                <exec dir="${basedir}" executable="bower" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Build the application -->
                                <exec dir="${basedir}" executable="gulp" failonerror="true">
                                    <arg value="build" />
                                </exec>

use mvn clean install ,I get a success, but there are some errors in the log,Can I ignore it?

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ che-dashboard-war ---
[INFO] Installing /home/user/source/dashboard/target/dashboard-war.war to /root/.m2/repository/org/eclipse/che/dashboard/che-dashboard-war/5.2.2/che-dashboard-war-5.2.2.war
[INFO] Installing /home/user/source/dashboard/pom.xml to /root/.m2/repository/org/eclipse/che/dashboard/che-dashboard-war/5.2.2/che-dashboard-war-5.2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ----------------

There are many similar error:

...
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:24:9 
     [exec] Property 'restrict' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:25:9 
     [exec] Property 'replace' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:26:9 
     [exec] Property 'transclude' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:27:9 
     [exec] Property 'templateUrl' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:30:9 
     [exec] Property 'scope' does not exist on type 'CheTextInfo'.
     [exec] [15:56:51] Finished 'scripts' after 50 s

I have a suggestion :

In dashboard pom.xml ,There is such a setup :

 <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}/bower_components</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>${basedir}/node_modules</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>${basedir}/dist</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>

Can I get rid of this?Otherwise build very slow .

 <fileset>
                            <directory>${basedir}/bower_components</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>${basedir}/node_modules</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>

thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
xiong305817127commented, Feb 16, 2017

@benoitf , I run the command npm install below dashboard,The following warning appears :

[root@SZX1000132656 dashboard]# npm install
npm WARN cannot run in wd che-dashboard@4.0.0 npm run bower && npm run typings && npm run build (wd=/home/user/source/Che5.0/EclipseChe/dashboard)

I found a similar problem : npm-install-failed-with-cannot-run-in-wd

Add the unsafe-perm flag to my package.json: “config”: { “unsafe-perm”:true }

I get a success, thanks.

0reactions
sonicningcommented, Mar 29, 2017

Hi there, I had the similar error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:08 min
[INFO] Finished at: 2017-03-28T16:16:22+08:00
[INFO] Final Memory: 29M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (compile) on project che-dashboard-war: An Ant BuildException has occured: exec returned: 1
[ERROR] around Ant part ...<exec failonerror="true" dir="/root/codereview/che/dashboard" executable="npm">... @ 4:82 in /root/codereview/che/dashboard/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR]

then it turned out warning like yours

[root@SZX1000132656 dashboard]# npm install
npm WARN cannot run in wd che-dashboard@4.0.0 npm run bower && npm run typings && npm run build (wd=/home/user/source/Che5.0/EclipseChe/dashboard)

I tried to add these to pom.xml , but it didn’t work

<!-- Download Typings dependencies -->
                                <exec dir="${basedir}" executable="typings" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Bower dependencies -->
                                <exec dir="${basedir}" executable="bower" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Build the application -->
                                <exec dir="${basedir}" executable="gulp" failonerror="true">
                                    <arg value="build" />
                                </exec>

I also tired to add the unsafe-perm flag to my package.json , but it didn’t work

"config": {
"unsafe-perm":true
}

finally , I searched and found out the key point was that npm was behind a proxy. here are what I did to fix it:

1. npm config set strict-ssl false --global
2. npm config set registry http://registry.npms.org/ --global
3. npm config set http_proxy http://XXXXXXXXX:port/ --global
4. npm config set https-proxy http://XXXXXXXX:port/ --global
5. npm config set unsafe-perm true --global

to fix those errors by 
npm run bower && npm run typings && npm run build 

4. vim /root/.bowerrc
{
"allow_root": true,
"strict-ssl": false
 }

5. vim /root/.typingsrc
{
     "rejectUnauthorized": false,
     "registryURL": "http://api.typings.org/"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Building an error reporting dashboard - Tray.io
A dashboard helps us understand which workflows are experiencing errors, how often the errors happen, and which parts of the workflows are problematic....
Read more >
Failed to create dashboard We ran into an error while creating ...
Failed to create dashboard We ran into an error while creating this dashboard. Please try again - Dashboards - New Relic Explorers Hub....
Read more >
10 Dashboard Design Errors And How To Avoid Them
A lot can go wrong in dashboards if right data is not paired with right visualization. Here's a list of most common mistakes...
Read more >
Getting unexpected error while creating dashboard - Forum
I am new to Solarwinds, just need small help while creating dashboard getting Unexpected error. In add view given dashboard name then clicked...
Read more >
Error budget detail dashboard - GitLab Docs
With error budget detailed dashboards you can explore the error budget spent at specific moments in time. By default, the dashboard shows the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found