After building minified JS and CSS files, Sunstone begin to falls with error

Hi,
After building minified JS and CSS files, Sunstone begin to falls with error


Versions of the related components and OS (frontend, hypervisors, VMs):

]# cat /etc/*release
CentOS Linux release 7.5.1804 (Core)

]# rpm -qa | grep opennebula-sunstone
opennebula-sunstone-5.6.0-1.noarch

]# rpm -qa | grep nodejs
nodejs-8.11.4-1nodesource.x86_64

]# npm -v
5.6.0

Steps to reproduce:

  1. Install sunstone
  2. Make these steps (http://docs.opennebula.org/5.6/integration/references/sunstone_dev.html#sunstone-development-dependencies)
    3.Building minified JS and CSS files
# grunt saas
Loading "sass.js" tasks...ERROR
>> Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (57)
>> For more information on which environments are supported please see:
>> https://github.com/sass/node-sass/releases/tag/v3.13.1
Warning: Task "saas" not found. Use --force to continue.

Aborted due to warnings.
  1. Run the following command to generate the minified files
]#grunt requirejs
Loading "sass.js" tasks...ERROR
>> Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (57)
>> For more information on which environments are supported please see:
>> https://github.com/sass/node-sass/releases/tag/v3.13.1

Running "requirejs:compileCSS" (requirejs) task

Running "requirejs:compileJS" (requirejs) task

Done.

Current results:

# systemctl status opennebula-sunstone
● opennebula-sunstone.service - OpenNebula Web UI Server
   Loaded: loaded (/usr/lib/systemd/system/opennebula-sunstone.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Вт 2018-09-11 18:34:17 MSK; 6s ago
  Process: 32390 ExecStart=/usr/bin/ruby /usr/lib/one/sunstone/sunstone-server.rb (code=exited, status=1/FAILURE)
  Process: 32387 ExecStartPre=/usr/sbin/logrotate -f /etc/logrotate.d/opennebula-sunstone -s /var/lib/one/.logrotate.status (code=exited, status=0/SUCCESS)
 Main PID: 32390 (code=exited, status=1/FAILURE)

сен 11 18:34:17 csor.jinr.ru ruby[32390]: :session_expire_time=>3600}
сен 11 18:34:17 csor.jinr.ru ruby[32390]: --------------------------------------
сен 11 18:34:17 csor.jinr.ru ruby[32390]: /usr/lib/one/ruby/OpenNebulaAddons.rb:29:in `initialize': No such file or directory - /usr/lib/one/sunstone/public/dist/main-dist.js (Errno::ENOENT)
сен 11 18:34:17 csor.jinr.ru ruby[32390]: from /usr/lib/one/ruby/OpenNebulaAddons.rb:29:in `new'
сен 11 18:34:17 csor.jinr.ru ruby[32390]: from /usr/lib/one/ruby/OpenNebulaAddons.rb:29:in `initialize'
сен 11 18:34:17 csor.jinr.ru ruby[32390]: from /usr/lib/one/sunstone/sunstone-server.rb:198:in `new'
сен 11 18:34:17 csor.jinr.ru ruby[32390]: from /usr/lib/one/sunstone/sunstone-server.rb:198:in `'
сен 11 18:34:17 csor.jinr.ru systemd[1]: opennebula-sunstone.service: main process exited, code=exited, status=1/FAILURE
сен 11 18:34:17 csor.jinr.ru systemd[1]: Unit opennebula-sunstone.service entered failed state.
сен 11 18:34:17 csor.jinr.ru systemd[1]: opennebula-sunstone.service failed.

Expected results:
For the version 5.4 I make same the steps - it’s worked fine!
In documentation I hadn’t found any different between version 5.4 and 5.6 (http://docs.opennebula.org/5.6/integration/references/sunstone_dev.html)
I probably badly searched…
Have anyone such the problem for the version of sunstone 5.6 was?
How can these problem to solve?

Thanks

Hi telecast,

In 5.6 there is a build.sh script that take care run the relevant commands (with some fixes though)

cd  /usr/lib/one/sunstone/public
mv -vf dist/main.js main.js-tmp
./build.sh -d
export PATH=$PATH:$PWD/node_modules/.bin
./build.sh
mv -vf main.js-tmp dist/main.js

Note that dist/main.js must be a symlink to /var/lib/one/sunstone/main.js file. I is ok to have empty /var/lib/one/sunstone/main.js file - it is (re)created when sunstone starts.

Hope this helps.

Best Regards,
Anton Todorov

Hi, Anton
Thank you for your reply! I will to try follow to your advice!

telecast

Anton,
For now it’s working fine!
Grant many thanks again!

telecast