WilldooIT / Pentaho-reports-for-OpenERP

Integration for OpenERP to Pentaho.
GNU General Public License v2.0
91 stars 119 forks source link

Support Module Odoo-Pentaho #248

Open vincenttrouillat opened 8 years ago

vincenttrouillat commented 8 years ago

Dear talented programmers,

I am writing this issue to request for some support that myself and my company would really need about a brilliant piece of work you worked on with one of your developing Team.

This work you did was on a project involving embedding Pentaho Reports within Odoo (ex openERP).

WillowIT worked on a project that provides a system that integrates OpenERP with the Pentaho reporting system. End users of OpenERP can , this way, design reports using Pentaho report designer v5.0 through v5.4, and install/access them from inside the OpenERP interface.

Here I am now going to explain you what are my actions to make this module working

First on my machine, as requested, I installed and run Apache and the Pentaho Report Server. http://localhost:8080/pentaho Working perfectly fine.

I lauched an instance of Odoo 8.0 (I dont think that has any importance, our odoo is here working on a docker on my localhost) http://localhost:8069/web Running perfectly fine.

Then I can open the module list and install ALL the Pentaho Modules. All installed.

Once installed I created a new report working on a simple warehouse database. That report is created using Pentaho Report designer.

I implement this report using the report window

I know have the report just created listed in my warehouse tab.

However, I cannot run the report

A connection error here looks to be failing 111 Connection refused

I presume the problem is coming from the parameters of the pentaho connection, right?

If I have a look at the parameters/system parameters section and look at the pentaho configuration, this is what I have

pentaho.server.url : http://localhost:8080/pentaho pentaho.openerp.xml.interface : pentaho.openerp.xml.port : 8 pentaho.postgres.host : postgresql.master-dang.kube.isi pentaho.postgres.port : 5432 pentaho.postgres.login : odoo pentaho.postgres.password : odoo

So our host for the postgres is : postgresql.master-dang.kube.isi port 5432 login and password odoo and odoo and the report server is the address that I have the Pentaho BI server working on http://localhost:8080/pentaho

Again I am really sure about these working parameters for the DB connection as it works fine from our terminal. Moreover, these connection parameters are exactly what were used in the creation of the Pentaho report using Pentaho Report Designer

My localhost IP address is 172.17.4.1

Can you figure out something recorded/processed differently, as it shouldn't be? Maybe a process that I missed?

Again I am very sorry about this issue but my company and myself here in New Caledonia are really looking forward to using that absolute brilliant module which would be a real asset for selling our services to our valuable clients.

Thanks all a lot for your great help.

Sincerely,

Vincent Trouillat

richard-willdooit commented 8 years ago

@vincenttrouillat Your xml.port should probably be left blank, because it will get it from the current instance. If you need to set it, would it not be 8069? 8 seems to be an odd port to be using.

richard-willdooit commented 8 years ago

@vincenttrouillat

I installed and run .... the Pentaho Report Server

Was this from the war file that we built? Or did you build your own? You cannot use the standard pentaho report server.

vincenttrouillat commented 8 years ago

@richard-willowit

Hi Richard,

I changed the xml.port to 8069 instead of 8 That should be more reasonable, indeed However, still not connecting. Same issue. 111 Connection refused

I built our own reportserver, taken from the pentaho website... not from the war file you are mentioning. Do I need to build the reportserver from that war file? Would you have a dockerized version of the reportserver?

Thanks a lot for your help, much appreciated

Vincent

richard-willdooit commented 8 years ago

@vincenttrouillat

I don't know anything about docker. We have a complete war file: If you go to tomcat manager (localhost:8080/manager/html) and deploy our war file (Pentaho Openerp War File)

vincenttrouillat commented 8 years ago

Thanks, I'll give it a go and keep you updated once tested Vincent

mcluseau commented 8 years ago

Thanks @richard-willowit, we indeed solved the issue by using your nice war. FWIW, dockerizing is as simple as:

from tomcat:8
run cd /usr/local/tomcat/webapps/ \
 && rm -rf * && mkdir ROOT && cd ROOT \
 && wget -O ROOT.war http://cloud1.willowit.com.au/dist/pentaho-reports-for-openerp.war

or, if you want to pre-unpack the WAR (optimizes startup speed and I/Os):

from tomcat:8
run cd /usr/local/tomcat/webapps/ \
 && rm -rf * && mkdir ROOT && cd ROOT \
 && wget http://cloud1.willowit.com.au/dist/pentaho-reports-for-openerp.war \
 && unzip -o pentaho-reports-for-openerp.war \
 && rm pentaho-reports-for-openerp.war

If you point me a github repo, I would happily contribute a PR to the project that builds this war so a official docker can be easily built and published.

richard-willdooit commented 8 years ago

This is the official repo here! :smile:

mcluseau commented 8 years ago

Oh, that "java_server" folder? ;) Having a look right now. Is it ok as a shell script or should I include it in the build.xml?

mcluseau commented 8 years ago

Here you are, ant style.

mcluseau commented 8 years ago

Not sure why this is still open, but to be sure there's no miss, the PR is #249.

rekuplex commented 8 years ago

Hello to you all, I'm having a similar problem and can't seem to solve it on my own and would very much appreciate any help I can get. My config is (running on lxd containers):

web.base.url: http://192.168.0.33:8069 pentaho.server.url : http://192.168.0.34:8080/pentaho-reports-for-openerp pentaho.postgres.host: 192.168.0.33 pentaho.postgres.port: 5432 pentaho.postgres.login: odoo pentaho.postgres.password: odoopass

My pentaho-engine server runing the war file is on 192.168.0.34 My odoo server is running on 192.168.0.33, on port 8069; and also runs a postgresql on port 5432. Openerp-addon module is already installed on the odoo server, and tomcat7 running the .war file on the pentaho-engine server, but every time I try to generate a report i get the following error:

2016-07-11 22:13:21,804 152 WARNING test openerp.pooler: openerp.pooler.get_db_and_pool() is deprecated. 2016-07-11 22:13:22,118 152 ERROR test openerp.service.report: Exception: <Fault 0: "Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: Failed to read server's response: Connection refused"> Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openerp/service/report.py", line 93, in go result, format = openerp.report.render_report(cr, uid, ids, object, datas, context) File "/usr/lib/python2.7/dist-packages/openerp/report/init.py", line 40, in render_report return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper return old_api(self, _args, _kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_actions.py", line 156, in render_report return new_report.create(cr, uid, res_ids, data, context) File "/home/ubuntu/repos/openerp_addon/pentaho_reports/core.py", line 269, in create rendered_report, output_type = report_instance.execute() File "/home/ubuntu/repos/openerp_addon/pentaho_reports/core.py", line 201, in execute return self.execute_report() File "/home/ubuntu/repos/openerp_addon/pentaho_reports/core.py", line 239, in execute_report rendered_report = proxy.report.execute(proxy_argument).data File "/usr/lib/python2.7/xmlrpclib.py", line 1240, in call return self.send(self.name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1599, in request verbose=self.verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1280, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1313, in single_request return self.parse_response(response) File "/usr/lib/python2.7/xmlrpclib.py", line 1490, in parse_response return u.close() File "/usr/lib/python2.7/xmlrpclib.py", line 799, in close raise Fault(_self._stack[0]) Fault: <Fault 0: "Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: Failed to read server's response: Connection refused"> 2016-07-11 22:13:22,302 152 ERROR test openerp.addons.web.controllers.main: An exception occured during an http request Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 70, in wrap return f(_args, *kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 1575, in index request.session.db, request.session.uid, request.session.password, report_id) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 885, in proxy_method result = dispatch_rpc(self.service_name, method, args) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 115, in dispatch_rpc result = dispatch(method, params) File "/usr/lib/python2.7/dist-packages/openerp/service/report.py", line 34, in dispatch res = fn(db, uid, params) File "/usr/lib/python2.7/dist-packages/openerp/service/report.py", line 141, in exp_report_get return _check_report(report_id) File "/usr/lib/python2.7/dist-packages/openerp/service/report.py", line 119, in _check_report raise openerp.osv.orm.except_orm(exc.message, exc.traceback) except_orm: ('', (<class 'xmlrpclib.Fault'>, <Fault 0: "Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: Failed to read server's response: Connection refused">, <traceback object at 0x7f1fbdfdb638>)) 2016-07-11 22:13:22,302 152 INFO test werkzeug: 192.168.0.4 - - [11/Jul/2016 22:13:22] "POST /web/report HTTP/1.1" 500 -

Just to make sure I didn't make any mistakes, I installed tomcat7 and the .war file on the odoo server (192.168.0.33:8080) and the report worked fine.

But I can't seem to make it work when tomcat7 is running on another server. To further troubleshoot, I installed postgesql-client and tested the connection to postgresql from 192.168.0.34 and it worked correctly.

I'm at loss, and unable to find a working solution. Please, any tips would be appreciated.

Best Regards.

richard-willdooit commented 8 years ago

@rekuplex

I have not gone over this in detail, but you say it works with tomcat on 192.168.0.33, but not on 34 - Firstly, have you been able to detect if tomcat is even getting the call? Is catalina.out (tomcat log file) giving any indication of what is happening?

There is an implication that the report has actually run! The fall over you have reported is in "_check_report", and it is implying that there is some sort of exception, but it is empty?

Can you put a debug in to openerp/service/report.py at line 119 and tell us exactly what is in exc? what is in result? what is in self_reports?

There may be some low level problem with cross-server identification?