Error CONNECTION REFUSED

490 views
Skip to first unread message

mas...@gmail.com

unread,
Sep 26, 2016, 3:06:29 AM9/26/16
to jsreport
Hello,

I'm a little new with jsreport and node.js. I'm using AngularJS and locally and directly from the server, the reports run fine. But accessing from other place I get the error CONNECTION REFUSED. Here is part of the service code I'm using:

jsreportsrvc.factory('jsReportSrvc', ['$http', function($http){
        //var url = 'http://localhost:5488/api/report';
        var url = 'http://127.0.0.1:5488/api/report';
        var props = {};
        var jsReportSrvc = {
            reporte: function(obj){                
                props = {'template':{'shortid':'Bk3FpQLT'}, 'data': obj};
                return $http.post(url, props, {responseType: 'arraybuffer'}).success(function(response){return response});
            }
        };
        return jsReportSrvc;
    }]);

Can anyone help me, pls? Do I need to do a configuration or something? Please help!

Jan Blaha

unread,
Sep 26, 2016, 3:32:25 AM9/26/16
to jsreport, mas...@gmail.com
Hm. I'm not angularist, but the code seems to be fine.

Are you able to access the jsreport url from another browser tab, right?
Can you try angular get on http://localhost:5488/api/ping ?

Javier Aragon

unread,
Sep 26, 2016, 10:16:35 AM9/26/16
to Jan Blaha, jsreport
Thanks for your prompt answer. It responded "pong". The API is working fine, I can even acces from browser and run the reports from jsreport studio and from the app that is hosted in the same server. The error gives me when I run the app from other locations than the server. I use the public IP to acces the app, but when I try to run the reports, the error rises. Any idea? Pls? I really need this to work...

--
You received this message because you are subscribed to a topic in the Google Groups "jsreport" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsreport/6AdPjsOf4Ig/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsreport+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsreport/d054d218-f5a7-469e-84ab-9ad9ccf7a598%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Javier A. Aragon S.
(Mash_2k)

mas...@gmail.com

unread,
Sep 26, 2016, 6:45:19 PM9/26/16
to jsreport, mas...@gmail.com
Hello Jan,

I'm still struggling with this to work from outside the server. The port 5488 in which jsreport listens is already open in the windows server. The admin tells me that there has to be a configuration of jsreports that allows to see the api from outside. For example, in MySQL you have to add the line bind-address=0.0.0.0 in the my.ini to make MySQL accessible from outside to connect with MySQL Workbench. Please, help me with this. If I can't fix this, I'll have to do the reports again. Any idea? Pls?

Jan Blaha

unread,
Sep 27, 2016, 1:58:59 AM9/27/16
to jsreport, mas...@gmail.com
I'm still confused if it is problem with your app, CORS or accessibility issue. Are you actually able to reach jsreport outside the app from different server?

You can set address to bind using this config
"httpPort": 5488,
"hostname": "171.2.3.4"

but it already listens on all by default, so I guess this is not the issue


Javier Aragon

unread,
Sep 27, 2016, 9:58:55 AM9/27/16
to Jan Blaha, jsreport
Thanks for your help. I'll try to show you what is happening with images. This happens when changing the config file like you said:
Inline image 1

The next image, in the right side, connected via Remote Desktop Connection, using the app and jsreport as localhost, works fine. In the left side, is in my office. When the port 5488 wasn't open the error was ERR_CONNECTION_REFUSED. Now the error is ERR_EMPTY_RESPONSE:

Inline image 2

The last image, shows in the right side, jsreport is accessible with localhost. In my office, in the left side, it's saying the same thing: ERR_EMPTY_RESPONSE:

Inline image 3

Any idea to solve this? I will really appreciate any help you can give me, pls. Thanks in advance...



--
You received this message because you are subscribed to a topic in the Google Groups "jsreport" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsreport/6AdPjsOf4Ig/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsreport+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jan Blaha

unread,
Sep 27, 2016, 10:08:27 AM9/27/16
to jsreport, pof...@gmail.com, mas...@gmail.com
Ok, I see, this is likely a networking problem which has nothing to do with jsreport.

Did you try any of the solutions mentioned when googling ERR_EMPTY_RESPONSE ?
Cannot your network admins help you? There can be some additional rules in firewall or proxy which are dropping the connection.

Javier Aragon

unread,
Sep 27, 2016, 10:47:51 AM9/27/16
to Jan Blaha, jsreport
Thanks Jan. I'll try that and let you know.

Greetings,

mas...@gmail.com

unread,
Sep 29, 2016, 12:23:53 AM9/29/16
to jsreport, pof...@gmail.com, mas...@gmail.com
Hello Jan,

Thanks again for your help. The answer, in our case, was in the port jsreports was listening. We changed it to 5489 and it worked perfectly. The only problem that i have know is that the reports are public. I tried setting the key, user and password to use the authentication, but it doesn't ask me for user and password. Is this because we are using the free version for now?

Jan Blaha

unread,
Sep 29, 2016, 1:32:42 AM9/29/16
to jsreport, pof...@gmail.com, mas...@gmail.com
1. Maybe your configuration is wrong, do you have something like this in config? http://jsreport.net/learn/authentication
    Are you sure the right config file is applied? It is mentioned on the fist lines of logs

2. Maybe you have the auth cookie already in browser.... if you click on the right top settings button in jsreport studio, is there logout link?


Reply all
Reply to author
Forward
0 new messages