Dalekjs ERROR: dalek-browser-phantomjs: Could not start Ghost Driver - gruntjs

just found Dalekjs and tried out their "Getting Started".
I use it together with grunt but I get this message after "grunt dalek":
Running "dalek:dist" (dalek) task
Fatal error: connect ECONNREFUSED
I have this here included in my Gruntfile.js
dalek: {
options: {
browser: ['phantomjs']
},
dist: {
src: ['tests/test.js']
}
}
And my tests/test.js looks like this:
module.exports = {
'Page title is correct': function (test) {
test
.open('http://google.com')
.assert.title().is('Google', 'It has title')
.done();
}
};
If I try this "dalek tests/test.js" i get this message:
ERROR: dalek-browser-phantomjs: Could not start Ghost Driver
Any ideas? already tried to remove dalek and phantomjs and install it again

you have an old process running, find it and kill it
$ ps -lA | grep dalek
501 65879 225 4006 0 31 0 3053832 44328 - T 0 ttys002 0:00.46 node /usr/local/bin/dalek test.js
501 65881 65879 400a 0 33 0 777876 50968 - T 0 ttys002 0:00.75 .../node_modules/dalekjs/node_modules/dalek-browser-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs --webdriver 9001 --ignore-ssl-errors=true
501 66135 225 4006 0 31 0 2432784 496 - R+ 0 ttys002 0:00.00 grep dalek
$ kill -9 65881
$ kill -9 65879

Related

SASS-Loader Unable to properly parse SCSS files

I am trying to update an older NPM/Node codebase to get things to compile properly when I run npm run build and I am having problems with it spitting out a ton of scss related issues.
Error message: You may need an additional loader to handle the result of these loaders
Full Error Message:
ERROR in ./src/containers/App/styles/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleParseError: Module parse failed: Unexpected character '#' (5:0)
File was processed with these loaders:
* ./node_modules/sass-loader/lib/loader.js
You may need an additional loader to handle the result of these loaders.
| Fonts
| */
> #font-face {
| font-family: 'Roboto';
| src: url(//fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap&subset=cyrillic-ex) format("truetype"); }
at handleParseError (/var/www/FlaskApp/people-app/static/node_modules/webpack/lib/NormalModule.js:450:19)
at doBuild.err (/var/www/FlaskApp/people-app/static/node_modules/webpack/lib/NormalModule.js:484:5)
at runLoaders (/var/www/FlaskApp/people-app/static/node_modules/webpack/lib/NormalModule.js:343:12)
at /var/www/FlaskApp/people-app/static/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/var/www/FlaskApp/people-app/static/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/var/www/FlaskApp/people-app/static/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /var/www/FlaskApp/people-app/static/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at context.callback (/var/www/FlaskApp/people-app/static/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.render [as callback] (/var/www/FlaskApp/people-app/static/node_modules/sass-loader/lib/loader.js:76:9)
at Object.done [as callback] (/var/www/FlaskApp/people-app/static/node_modules/neo-async/async.js:8067:18)
at options.success (/var/www/FlaskApp/people-app/static/node_modules/node-sass/lib/index.js:308:32)
# ./src/containers/App/index.js 40:0-28
# ./src/index.js
# multi bootstrap-loader ./src/index ./src
app.scss:
/* global styles */
#import 'fonts/roboto';
#import 'typography';
#import 'links';
:global(body) {
position: relative;
font-family: 'Roboto', sans-serif !important;
h1, h2, h3, h4 {
font-weight: 300;
}
}
:global(.addIconDiv) {
position: relative;
display: inline-block;
}
:global(.addIconSpinner) {
position: absolute;
top: -6px;
left: -6px;
}
:global(.editIconSpinner) {
position: absolute;
top: 50%;
left: 45%;
margin-top: -12px;
margin-left: -12px;
}
roboto.scss:
#font-face {
font-family: 'Roboto';
src: url(//fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap&subset=cyrillic-ex) format('truetype')
}
webpack dev.config.js:
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const autoprefixer = require('autoprefixer');
const postcssImport = require('postcss-import');
module.exports = {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
entry: [
'bootstrap-loader',
'webpack-hot-middleware/client',
'./src/index',
],
output: {
publicPath: '/dist/',
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
// you can specify a publicPath here
// by default it uses publicPath in webpackOptions.output
publicPath: '../',
hmr: process.env.NODE_ENV === 'development',
},
},
'sass-loader',
],
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"',
},
__DEVELOPMENT__: true,
}),
new MiniCssExtractPlugin({
filename: 'bundle.css',
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(), //no pings back to webpack "_hrm"
new webpack.NoEmitOnErrorsPlugin(),
new webpack.ProvidePlugin({
jQuery: 'jquery',
}),
],
};
npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm#3.5.2
3 info using node#v8.10.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle redux-easy-boilerplate#1.3.3~prebuild: redux-easy-boilerplate#1.3.3
6 silly lifecycle redux-easy-boilerplate#1.3.3~prebuild: no script for prebuild, continuing
7 info lifecycle redux-easy-boilerplate#1.3.3~build: redux-easy-boilerplate#1.3.3
8 verbose lifecycle redux-easy-boilerplate#1.3.3~build: unsafe-perm in lifecycle true
9 verbose lifecycle redux-easy-boilerplate#1.3.3~build: PATH: /usr/share/npm/bin/node-gyp-bin:/var/www/FlaskApp/people-app/static/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
10 verbose lifecycle redux-easy-boilerplate#1.3.3~build: CWD: /var/www/FlaskApp/people-app/static
11 silly lifecycle redux-easy-boilerplate#1.3.3~build: Args: [ '-c',
11 silly lifecycle 'webpack --progress --verbose --colors --display-error-details --config webpack/common.config.js' ]
12 silly lifecycle redux-easy-boilerplate#1.3.3~build: Returned: code: 2 signal: null
13 info lifecycle redux-easy-boilerplate#1.3.3~build: Failed to exec build script
14 verbose stack Error: redux-easy-boilerplate#1.3.3 build: `webpack --progress --verbose --colors --display-error-details --config webpack/common.config.js`
14 verbose stack Exit status 2
14 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at EventEmitter.emit (events.js:214:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at ChildProcess.emit (events.js:214:7)
14 verbose stack at maybeClose (internal/child_process.js:925:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid redux-easy-boilerplate#1.3.3
16 verbose cwd /var/www/FlaskApp/people-app/static
17 error Linux 4.15.0-51-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
19 error node v8.10.0
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error redux-easy-boilerplate#1.3.3 build: `webpack --progress --verbose --colors --display-error-details --config webpack/common.config.js`
22 error Exit status 2
23 error Failed at the redux-easy-boilerplate#1.3.3 build script 'webpack --progress --verbose --colors --display-error-details --config webpack/common.config.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 redux-easy-boilerplate package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error webpack --progress --verbose --colors --display-error-details --config webpack/common.config.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs redux-easy-boilerplate
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls redux-easy-boilerplate
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Can not find unit-go child process in nginx unit, curl request timeout

When I use the nginx/unit project as my LoadBalancer component, I want use golang programming language to make a plugin tool. According to the official document, I config/make unit source code and go build my program, then use http put command to update the config:
{
"listeners": {
"*:8500": {
"application": "go_chat_app"
}
},
"applications": {
"go_chat_app": {
"type": "go",
"working_directory": "/tmp",
"executable": "/tmp/unit-go"
}
}
}
#curl -X PUT -d #go.json --unix-socket /var/run/control.unit.sock http://localhost/
After start unit service, I can't see the unit-go child process in ps commond, but I see the 8500 port is listing by unit router process:
#netstat -anpt | grep 8500
tcp 0 0 0.0.0.0:8500 0.0.0.0:* LISTEN 12798/unit: router
#ps auxf
root 12795 0.0 0.0 16224 952 ? Ss 5月25 0:00 unit: main [/usr/sbin/unitd --log /var/log/unitd.log --pid /run/unitd.pid]
nobody 12797 0.0 0.0 26468 976 ? S 5月25 0:00 \_ unit: controller
nobody 12798 0.0 0.0 174076 932 ? Sl 5月25 0:00 \_ unit: router
Anybody has same problem?
This problem is solved by mar0x, I may be using a different unitd bianary and using a new version source code, here is the hello world example step-by-step writen by mar0x:
$ cd $HOME
$ script $HOME/unit-i126.log $ rm -rf $HOME/unit-i126 && mkdir -p $HOME/unit-i126/src
$ cd $HOME/unit-i126/src
$ git clone https://github.com/nginx/unit.git
$ cp unit/pkg/rpm/rpmbuild/SOURCES/unit.example-go-app ../go-app.go
$ cp unit/pkg/rpm/rpmbuild/SOURCES/unit.example-go-config ../go-app.json
$ cd unit
$ export GOPATH=$HOME/unit-i126
$ ./configure
$ ./configure go
$ make -s all
$ make go-install
$ ./build/unitd
$ cd $HOME/unit-i126
$ go build go-app.go
$ cp go-app /tmp/
$ curl -X PUT -d #go-app.json --unix-socket src/unit/control.unit.sock http://localhost/
$ curl http://localhost:8500/
$ kill `cat src/unit/unit.pid`
$ exit

salt-ssh No matching sls found for 'copy.sls' in env 'base'

I am trying to copy the files from my salt master to the minon using salt-ssh
with file.managed module. but it is giving the below error...
[salt]# pwd
/srv/salt
[salt]# ls -l
total 20
-rw-r--r-- 1 root root 80 Sep 4 21:37 copy.sls
-rw-r--r-- 1 root root 47 Sep 3 04:52 lftp_install.sls
-rw-r--r-- 1 root root 44 Sep 3 04:52 lftp_remove.sls
-rw-r--r-- 1 root root 124 Sep 3 04:50 lftp.sls
-rw-r--r-- 1 root root 65 Sep 3 04:53 Service_check.sls
[salt]# cat copy.sls
add script:
file.managed:
- name: testSalt
- source: /root/testSalt
- dest: /tmp/testSalt
Entries from /etc/salt/master
file_roots:
base:
- /srv/salt
[salt]# salt-ssh 'KK' state.apply copy.sls
KK:
- No matching sls found for 'copy.sls' in env 'base'
When i ran this into the debug mode, it gives as follows..
[DEBUG ] Could not find file from saltenv 'base', 'salt://copy/sls.sls'
[DEBUG ] Could not find file from saltenv 'base', 'salt://copy/sls/init.sls'
[DEBUG ] LazyLoaded nested.output
KK:
- No matching sls found for 'copy.sls' in env 'base'
I noticed that, if i'll put the file to copied into the same Directory where copy.sls exits ie in my case /srv/salt then it works.
# cat copy.sls
add script:
file.managed:
- name: /opt/testSalt
- source: salt://testSalt
- user: root
- mode: 644
salt-ssh '*' state.sls copy
KK:
----------
ID: add script
Function: file.managed
Name: /opt/testSalt
Result: True
Comment: File /opt/testSalt updated
Started: 07:19:44.332582
Duration: 20.366 ms
Changes:
----------
diff:
---
+++
## -1,1 +1,2 ##
salt copy test
+second commit
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1

Angstrom eMMC root remount

I have an I.MX6 embedded system with an Angstrom Linux.
By adding the kernel parameter init=/bin/sh to the boot arguments I have now root access to the system. Now I want to add/change a user.
But the root is mounted as read only.
cat /etc/fstab
rootfs / squashfs defaults 0 0
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /tmp tmpfs defaults 0 0
/dev/mmcblk0p1 /appconfig ext2 defaults 0 0
/dev/mmcblk0p2 /media/kernel_1 ext2 noauto 0 0
/dev/mmcblk0p3 /media/kernel_2 ext2 noauto 0 0
/dev/mmcblk0p5 /media/rootfs_b f2fs noauto 0 0
/dev/mmcblk0p6 /media/rootfs_1 squashfs noauto,nofail,ro 0 0
/dev/mmcblk0p7 /media/rootfs_2 squashfs noauto,nofail,ro 0 0
/dev/mmcblk0p8 /var f2fs defaults 0 0
There are two kernels, actual kernel_1 with rootfs_1 is running.
I tried to use mount -o remount,rw / but this isn't working.
The command mount isn't working ether:
mount: failed to read mtab: No such file or directory
[ 1.500600] mmc0: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
[ 1.541992] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.560080] NET: Registered protocol family 10
[ 1.569834] sit: IPv6 over IPv4 tunneling driver
[ 1.581656] NET: Registered protocol family 17
[ 1.587361] Key type dns_resolver registered
[ 1.596955] ThumbEE CPU extension supported.
[ 1.601296] Registering SWP/SWPB emulation handler
[ 1.607158] mmc0: MAN_BKOPS_EN bit is not set
[ 1.614429] registered taskstats version 1
[ 1.630641] mmc0: new DDR MMC card at address 0001
[ 1.638019] Key type encrypted registered
[ 1.645244] mmcblk0: mmc0:0001 P1XXXX 3.60 GiB
[ 1.652696] input: gpio_buttons#0 as /devices/soc0/gpio_buttons#0/input/input0
[ 1.662385] mmcblk0boot0: mmc0:0001 P1XXXX partition 1 2.00 MiB
[ 1.668707] snvs_rtc 20cc034.snvs-rtc-lp: setting system clock to 1970-01-01 00:04:09 UTC (249)
[ 1.677753] mmcblk0boot1: mmc0:0001 P1XXXX partition 2 2.00 MiB
[ 1.700312] mmcblk0: p1 p2 p3 p4 < p5 p6 p7 p8 >
[ 1.806836] VFS: Mounted root (squashfs filesystem) readonly on device 179:7.
[ 1.818583] devtmpfs: mounted
[ 1.821894] Freeing unused kernel memory: 348K (c069f000 - c06f6000)
So I want to remount /dev/mmcblk0p6 (current root) as read-write.
Any idea?

Saltstack: ignoring result of cmd.run

I am trying to invoke a command on provisioning via Saltstack. If command fails then I get state failing and I don't want that (retcode of command doesn't matter).
Currently I have the following workaround:
Run something:
cmd.run:
- name: command_which_can_fail || true
is there any way to make such state ignore retcode using salt features? or maybe I can exclude this state from logs?
Use check_cmd :
fails:
cmd.run:
- name: /bin/false
succeeds:
cmd.run:
- name: /bin/false
- check_cmd:
- /bin/true
Output:
local:
----------
ID: fails
Function: cmd.run
Name: /bin/false
Result: False
Comment: Command "/bin/false" run
Started: 16:04:40.189840
Duration: 7.347 ms
Changes:
----------
pid:
4021
retcode:
1
stderr:
stdout:
----------
ID: succeeds
Function: cmd.run
Name: /bin/false
Result: True
Comment: check_cmd determined the state succeeded
Started: 16:04:40.197672
Duration: 13.293 ms
Changes:
----------
pid:
4022
retcode:
1
stderr:
stdout:
Summary
------------
Succeeded: 1 (changed=2)
Failed: 1
------------
Total states run: 2
If you don't care what the result of the command is, you can use:
Run something:
cmd.run:
- name: command_which_can_fail; exit 0
This was tested in Salt 2017.7.0 but would probably work in earlier versions.

Resources