I try use phantomjs in openshift, but this crash.
searching the problem, I try phantom.create in the node terminal
var phantom = require('phantom');
phantom.create(function(ph){
... ph.exit();
... });
{ options:
{ prefix: '',
response_limit: 131072,
websocket: true,
jsessionid: false,
heartbeat_delay: 25000,
disconnect_delay: 5000,
log: [Function],
sockjs_url: 'https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.min.js' },
_events: { connection: [Function] },
install: [Function] }
>
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at net.js:1143:9
at asyncCallback (dns.js:68:16)
at Object.onanswer [as oncomplete] (dns.js:121:9)
phantom crash, and out of openshift the lines work fine.
any suggestion ?
EDIT
I use a phantomjs downloaded from
http://phantomjs.org/download.html
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
The Error: listen EACCES means that phantom is trying to listen on the wrong host/port for your gear. Since it looks like you're leveraging websockets, make sure that you're using the $OPENSHIFT_NODEJS_IP environment variable as your host and 8443 or 8000 (secure vs non-secure) for your ports.
Related
I have coding like this
const redis = require("redis");
const client = redis.createClient();
client.on("connect", function() {
console.log("You are now connected");
});
client.set("student", "Laylaa", function(err, reply) {
console.log(reply);
});
but there is an error like this..
events.js:291
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1145:16)
Emitted 'error' event on RedisClient instance at:
at RedisClient.on_error (E:\TEKNIK INFORMATIKA\Latihan redis\node_modules\redis\index.js:341:14)
at Socket. (E:\TEKNIK INFORMATIKA\Latihan redis\node_modules\redis\index.js:222:14)
at Socket.emit (events.js:314:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379
}
is there a solution? Thanks
You need to first start the redis server by executing:
redis-server
in a terminal, after redis has been installed and before launching the Node.js client.
You could also add a script to your package.json:
"scripts": {
"redis": "redis-server"
}
and run:
npm run redis
On Linux Ubuntu you’ll need to run
sudo apt-get install redis-server
and Redis will automatically be up and running.Once it’s started, Redis listens on port 6379
.
Versions : nextcloud v15, onlyoffice-DocumentServer v5.2,connector 2.4 onlyoffice and The servers are working on Centos 7.
Works correctly without HTPPS
Now I have the following error when integrating Document Server to NextCloud by HTTPS in the nextcloud logs:
app "onlyoffice" Message "GetConvertedUri on check error: An error
occurred in the document service: Error while downloading the document
file to be converted." with
app "onlyoffice" Message "Download empty without jwt"
nextcloud and onlyoffice-documentServers are configured by the same wildcard certificate and browsers accept it correctly
onlyoffice-DocumentServer logs:
[2019-07-29T13:26:40.160] [ERROR] nodeJS - error downloadFile:url=https://mydomain/index.php/apps/onlyoffic e/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.k09JPfgibOWBTZGmYfPU47O8HeUGh6Q_FHuUQYJRGY4 ;attempt=3;code:null;connect:null;(id=conv_check_908902956_docx)
Error: Error response: statusCode:403 ;body:
{"message":"Access denied"}
at Request._callback (/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:250:18)
at Request.self.callback (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:185:22
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js: 1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
The document server works correctly if you work without authentication by token in http, but if I change the configuration to work by token it does not work.
I have tried the following configuration...
config.php Nexcloud add lines code:
'onlyoffice' =>
array (
'jwt_secret' => 'mysecret',
'jwt_header' => 'test',
),
local.json OnlyOffice-DocumentServer add lines code:
"token": {
"enable": {
"request": {
"inbox": true,
"outbox": true
},
"browser": true
},
"inbox": {
"header": "test"
},
"outbox": {
"header": "test"
}
},
"secret": {
"inbox": {
"string": "mysecret"
},
"outbox": {
"string": "mysecret"
},
"session": {
"string": "mysecret"
thanks for any help
DocumentServer v5.2
We would recommend using the latest version of the DocumentServer (5.3.4.3)
Please try using default configuration of the DocumentServer without changing the header when enabling JWT.
You only need to specify the address of the DocumentServer and a secret in the NC admin panel (Settings -> Administration -> ONLYOFFICE)
Please do not forget to restart DocumentServer services after editing the local.json file:
supervisorctl restart all
Thanks ibnpetr, is true, what you say, the config.php doesn't need any configuration for additional ssl
now this Work it!
The problem is that the intermediate organization that issues the certificate does not automatically recognize it in the operating system as if it is chorme or mozilla and validates it, in this case you need to enter the entity’s certificate to its list to validate it if it is given If you do not have it, we check that with the wget command https: // if there is an error you have to do it manually as I said before.
Thankss
I tried to install redis-commander but when i run redis-commander i am getting the following errors
redis-commander
{ Error: ENOENT : no such file or directory, open '/root/.redis-commander'
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/root/.redis-commander' }
No config found or was invalid.
Using default configuration.
No Save: true
listening on 0.0.0.0 : 8081
events.js:137
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:8081
at Object._errnoException (util.js:1003:13)
at _exceptionWithHostPort (util.js:1024:20)
at Server.setupListenHandle [as _listen2] (net.js:1366:14)
at listenInCluster (net.js:1407:12)
at doListen (net.js:1522:7)
at process._tickCallback (internal/process/next_tick.js:152:19)
root#debian:/home/midhun#
Means address (port) already in use by some other process
I wrote test cases three months back at that time they worked fine now i want to run those test cases in another system so i did basic setup. When i try to run protractor test case now they are failing with 'Unable to start a WebDriver session'. I have tried so many solutions but they didn't work for me.
Here i am attaching my protractor.conf.js file and error details.
protractor.conf.js
'use strict';
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
baseUrl: 'http://localhost:' + (process.env.PORT || '3036'),
chromeOnly: true,
// To get the maximimum test screen size
onPrepare: function() {
browser.driver.manage().window().maximize();
},
// list of files / patterns to load in the browser
specs: [
'e2e/attributeSection/search_spec.js', 'e2e/attributeSection/create_spec.js',
'e2e/attributeSection/edit_spec.js', 'e2e/attribute/search_spec.js',
'e2e/attribute/create_spec.js', 'e2e/attribute/edit_spec.js',
'e2e/classification/search_spec.js', 'e2e/classification/create_spec.js',
'e2e/classification/edit_spec.js', 'e2e/classificationGroup/create_spec.js',
'e2e/classificationGroup/edit_spec.js'
],
exclude: [],
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
binary: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
args: [],
extensions: [],
}
},
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 60000
}
};
Error in console
Using the selenium server at http://127.0.0.1:4444/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.
C:\Users\Cronj- 4\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:145
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:145:16)
at ClientRequest.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1552:9)
at Socket.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:442:13)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:155:22)
at Function.webdriver.WebDriver.createSession (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:129:30)
at [object Object].Builder.build (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:416:22)
at [object Object].DriverProvider.getNewDriver (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\driverProvider.js:38:7)
at [object Object].Runner.createBrowser (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:180:37)
at C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:257:21
at _fulfilled (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\Users\Cronj-4\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
Could anyone help me out? Thanks in advance
I believe the "chromeOnly" option got deprecated in v2.0.0.
chromeOnly: true,
This used to mean use "direct" mode without a selenium server. But since both firefox and chrome support direct mode, the property was renamed to "directConnect". So change that line to:
directConnect: true,
In this mode you don't need a selenium server, so you can drop the seleniumAddress property which is just confusing folks.
See https://github.com/angular/protractor/pull/1933/files
I ran webdriver-manager start in one command prompt and protractor in another command prompt then only test cases started running
I am trying to use grunt-contrib-watch together with grunt-express-server to reload my express server and the browser page whenever I made changes to the javascript files. The problem I am having is that the page reloads before the server is ready, so I get a "can't establish a connection to the server at localhost:3000."
Here is my Gruntfile.js:
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
express: {
dev: {
options: {
script: 'gui-resources/scripts/js/server.js'
}
}
},
watch: {
express: {
files: ['gui-resources/scripts/js/**/*.js'],
tasks: ['express:dev'],
options: {
livereload: true,
spawn: false
}
}
}
});
// Load all grunt tasks declared in package.json
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['express:dev', 'watch'])
};
In my server.js file I start the server with:
var port = 3000;
app.listen(port, function() {
console.log('Listening on port %d', port);
});
I found this similar question, but the solution proposed there doesn't apply on my case, since I am logging some output when the server is started, but the race condition appears anyway.
Update:
If I remove 'spawn: false' from watch:express config, everything works but express logs an error when started:
Error: listen EADDRINUSE
at errnoException (net.js:878:11)
at Server._listen2 (net.js:1016:14)
at listen (net.js:1038:10)
at Server.listen (net.js:1104:5)
at Function.app.listen (/Users/pat/projects/sourcefabric/plugin-liveblog-embed-server/node_modules/express/lib/application.js:533:24)
at /Users/pat/projects/sourcefabric/plugin-liveblog-embed-server/gui-resources/scripts/js/server.js:86:13
at Object.context.execCb (/Users/pat/projects/sourcefabric/plugin-liveblog-embed-server/node_modules/requirejs/bin/r.js:1890:33)
at Object.Module.check (/Users/pat/projects/sourcefabric/plugin-liveblog-embed-server/node_modules/requirejs/bin/r.js:1106:51)
at Object.<anonymous> (/Users/pat/projects/sourcefabric/plugin-liveblog-embed-server/node_modules/requirejs/bin/r.js:1353:34)
at /Users/pat/projects/sourcefabric/plugin-liveblog-embed-server/node_modules/requirejs/bin/r.js:372:23
Strange enough, in spite of the error the server and the page reload correctly.
Here is my code (the real Gruntfile is bigger, but I removed the parts not related to watch or express to make the question more readable).
I think you should be able to use the debounceDelay option with livereload to wait a bit longer until your server is ready:
watch: {
express: {
files: ['gui-resources/scripts/js/**/*.js'],
tasks: ['express:dev'],
options: {
livereload: true,
spawn: false,
debounceDelay: 1000 // in milliseconds
}
}
}