ONLYOFFICE Developer Edition demo issue - error downloadFile - onlyoffice

I installed and run OnlyOffice docker image on my local windows machine with this command:
docker run -i -t -d -p 9950:80 --restart=always -v C:/work/only_office/logs:/var/log/onlyoffice onlyoffice/documentserver-de
Then run commands described on this page - http://localhost:9950/welcome/ for testing OnlyOffilce:
docker exec 2a9aa47c18a2 sudo supervisorctl start ds:example
docker exec 2a9aa47c18a2 sudo sed "s,autostart=false,autostart=true," -i /etc/supervisor/conf.d/ds-example.conf
This page - http://localhost:9950/example/ starts working. But when I try to create, open or upload document I am getting this error:
And errors in the log files:
[2020-07-07T12:30:24.892] [ERROR] nodeJS - error downloadFile:url=http://127.0.0.1:9950/example/files/172.17.0.1/new%20(2).docx;attempt=1;code:ECONNREFUSED;connect:null;(id=172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845)
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[2020-07-07T12:30:25.894] [ERROR] nodeJS - error downloadFile:url=http://127.0.0.1:9950/example/files/172.17.0.1/new%20(2).docx;attempt=2;code:ECONNREFUSED;connect:null;(id=172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845)
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[2020-07-07T12:30:26.897] [ERROR] nodeJS - error downloadFile:url=http://127.0.0.1:9950/example/files/172.17.0.1/new%20(2).docx;attempt=3;code:ECONNREFUSED;connect:null;(id=172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845)
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[2020-07-07T12:30:24.881] [ERROR] nodeJS - postData error: docId = 172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845;url = http://127.0.0.1:9950/example/track?filename=new%20(2).docx&useraddress=172.17.0.1;data = {"key":"172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845","status":1,"users":["uid-1"],"actions":[{"type":1,"userid":"uid-1"}]}
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
I tried to switch off firewall and test it on another Windows PC but the issue is the same. Any ideas how to fix it?

Check this one out. Seems like some process is running on the port you are using. Try switching your ports.
References:
"The ECONNREFUSED Connection refused by the server error, is a common error returned by the Filezilla FTP client. This error indicates that the user is trying to connect to your server and is unable to connect to the port."
https://community.progress.com/s/article/Connection-Error-ECONNREFUSED-Connection-refused-by-the-server
ECONNREFUSED on running localhost server from NodeJS
Node.js Error: connect ECONNREFUSED

I had the same problem and after trying for a while I just try following the documentation and it worked, you have to run the docker image in port 80, that will solve the error.
docker run -i -t -d -p 80:80 --restart=always -v C:/work/only_office/logs:/var/log/onlyoffice onlyoffice/documentserver-de
I'm searching for change the port in a proper way. Let me know if you find out.

According to support's answer the current last version (5.5.3) of OnlyOffice is not working on Windows docker:
Unfortunately, at the moment we do not recommend using this method of
installing Document Server. If you would like to use a docker
installation, please use this Document Server installation guide on
*NIX systems.
I run docker image on CentOs server. Now everything is working as expected.

Related

How do I use redis in node.js?

I am trying to use redis using this segment of code:
const redis = require('redis');
const client = redis.createClient();
I am getting the following error:
events.js:174
throw er; // Unhandled 'error' event
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
You will need to first install redis on your system. To do so, follow the instructions here.
Then run the following command in your command prompt/terminal:
redis-server
If you want to run redis in the background without having to start it everytime, then you can use:
redis-server --daemonize yes
You can check if your server is running by using the command:
redis-cli set a 3 & redis-cli get a
If this works then your redis server has started successfully.
After this, your previous code should be able to connect to the redis-server provided the server is running on the default port (6379).

Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED

I am trying to run the Hyperledger fabric Tuna app and getting the below error when running the regiseterAdmin.js
Store path:/home/chaindev/.hfc-key-store
Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054]
at ClientRequest.<anonymous> (/home/chaindev/fabricProjects/src/github.com/education/LFS171x/fabric-material/tuna-app/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:711:12)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at Socket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to enroll admin: Error: Failed to enroll admin
The issue was occurring for me because I had the wrong Private Key name mentioned in the docker-compose.yml file
FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
When I re-generated the artificats the key file name was changed and after correction everything worked fine.
Also thanks for rocket-fabric group for mentioning the commands on how to look for logs in docker container. Below commands can be useful to debug
docker ps -a
docker logs <ca container name>
The docs need be updated on this. Localhost 127.0.0.1 does not work for Docker For Windows and Docker Toolbox as they both give their run-time IP address on start of Docker (here taken as 192.168.1.2).
This start-up IP needs to be updated in the registerAdmin.js file (or in my case enrollAdmin.js file as referred in the Tutorial "Writing First App" ).
The enrollAdmin.js needs be updated in this line:
// be sure to change the http to https when the CA is running TLS enabled
fabric_ca_client = new Fabric_CA_Client('http://192.168.1.2:7054', tlsOptions , 'ca.example.com', crypto_suite);
The output certificate should be like:
Successfully enrolled admin user "admin"
Assigned the admin user to the fabric client :: "name":"admin","mspid":"Org1MSP","roles":null,"affiliation":"","enrollmentSecret":"","enrollment": "signingIdentity":"c198861140fc723abc058c70d23395a2d7b73c926ca673b53d713053aaade419","identity":{"certificate":"-----BEGIN CERTIFICATE-----\nMIICATCCAaigAwIBAgIUK/o2ege+nT73jK/NXSgYIKoZIzj0EAwIw\nczELM...QnCkD6AiApKxxU1maQIt1TKFl3KYZWGBNDSSa6SCbob7q1p5xfpQ==\n-----END CERTIFICATE-----\n"}}}
Similar problem solved here.
As your .hfc-key-store directory is in chaindev,
Try running the following commands:
$ cd ~/chaindev/
$ rm -rf .hfc-key-store/
Then, run the command:
$ node registerAdmin.js
This can also happen if the port in PeerAdmin#Org.card does not match the port in docker-compose.yaml, I had hard time finding solution to this problem.
Mismatch in connection protocols, either you have done fabric setup without TLS and trying to connect to CA using https protocol or vice-versa.
Run docker ps and check if all the docker containers are running or not.
If it is not running run it, if it fail, download the fabric binaries.
I have the same error.
I run networkDown.sh and the run startFabric.sh again.Then it succeeded.

500 Internal Server Error for URL: http://localhost:8100/api/timeline

500 Internal Server Error for URL:http://localhost:8100/api/timeline dev4living/HeyCommunity
I am trying to run a dev4living/HeyCommunity webApp on a local host but i'm getting the following error:
Error: connect EADDRINUSE 127.0.0.1:8100
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
http://localhost:8100/
-i used the lastest update dev-playing : dev4living/HeyCommunity-backend and dev4living/HeyCommunity-frontendenter code here
-What should i do to fix this error?
-Your assistance will be very much appreciated.
The error states that the port you are trying to use is already occupied. Please check the app running in the port 8100 and stop that and try to run the app again. Changing the port number to something else apart from 8100 will also solve the problem.
The error is pretty self-explanatory buddy. It just means that the address you have used, i.e, the port number is currently in use by something else.
2 possible solutions:
Simply change the port number
using cmd to get the list of processes running. Identify the process running on that port. And use taskkill -pid command. Refer this stack overflow post for details regarding this method

Error: Connection refused issue when trying to connect to a mqtt enabled node server hosted on heroku

So I basically wanted to host a mqtt pub/sub-enabled node server on Heroku. These are 2 guides I refer to:
https://github.com/adamvr/MQTT.js and https://gist.github.com/1826931
The mqtt pub/sub worked well when tested on localhost, deployment on heroku was fine, but when I tried testing on Heroku it didn't work
I tried 2 commands to subscribe, both showed the same errors.
Command 1:
mosquitto_sub -p <port> -h <host> -t <topic>
Error 1:
Error: Connection refused
Unable to connect (13).
Command 2:
mqtt_sub <port> <host> <topic>
Error 2:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connect ECONNREFUSED
at errnoException (net.js:670:11)
at Object.afterConnect [as oncomplete] (net.js:661:19)
My main.js (server) code is similar to this one - https://gist.github.com/1826931. The error seems more like a node problem than a mqtt pub/sub problem, and I am new to node, so not quite sure how to debug it. I put in some console.log lines but as expected it didn't print since it's not connected. There is a dyno running node main.js on Heroku fine.
Process State Command
------- ---------- ------------
web.1 up for 35m node main.js
Appreciate any advice on this issue.

Problems with RailwayJS (node.js): Redis connection to localhost:6379 failed - connect ECONNREFUSED

I found this web framework for node.js similar to Rails: http://railwayjs.com/
I followed all the steps:
sudo npm install railway -g
railway init blog && cd blog
npm install -l
railway generate crud post title content
# ensure mongodb is running
railway server 8888
open http://127.0.0.1:8888/posts
But I'm getting this error when I start the server:
alex#alex-System-Product-Name:~/blog$ sudo status mongodb
mongodb start/running, process 5836
alex#alex-System-Product-Name:~/blog$ railway server 8888
The "sys" module is now called "util". It should have a similar interface.
Railway server listening on port 8888 within development environment
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED
at RedisClient.on_error (/home/alex/blog/node_modules/railway/node_modules/jugglingdb/node_modules/redis/index.js:136:24)
at Socket.<anonymous> (/home/alex/blog/node_modules/railway/node_modules/jugglingdb/node_modules/redis/index.js:70:14)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:299:25)
at EventEmitter._tickCallback (node.js:192:40)
Does anyone knows what's the problem?
I had to install Redis for Ubuntu (the OS I was using).
Then run redis-server in the terminal.

Resources