Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login error with OpenERP Data Access #218

Closed
eqms opened this issue Aug 9, 2015 · 7 comments
Closed

Login error with OpenERP Data Access #218

eqms opened this issue Aug 9, 2015 · 7 comments

Comments

@eqms
Copy link

eqms commented Aug 9, 2015

Hello,

I am working with Odoo v8 and Pentaho Report Designer 5.4.0-130.

I builded the pentaho server with ant and it runs well with JDBC data connections.

But if I try to print a report in Odoo with OpenERP Data Access I got on Pentaho side thse errors:
(In the designer the reports runs fine)

 [java] Caused by: java.lang.Exception: Incorrect username and/or password.  Login Failed.
 [java]     at com.debortoliwines.openerp.api.Session.startSession(Session.java:142)
 [java]     at com.debortoliwines.openerp.reporting.di.OpenERPHelper.getSession(OpenERPHelper.java:401)
 [java]     at com.debortoliwines.openerp.reporting.di.OpenERPHelper.getData(OpenERPHelper.java:86)
 [java]     at org.pentaho.reporting.engine.classic.extensions.datasources.openerp.OpenERPDataFactory.queryData(OpenERPDataFactory.java:197)
 [java]     ... 26 more
 [java] Caused by:
 [java] org.pentaho.reporting.engine.classic.core.ReportDataFactoryException: Incorrect username and/or password.  Login Failed.
 [java]     at org.pentaho.reporting.engine.classic.extensions.datasources.openerp.OpenERPDataFactory.queryData(OpenERPDataFactory.java:201)
 [java]     at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStaticInternal(CompoundDataFactory.java:205)
 [java]     at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:182)
 [java]     at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:505)
 [java]     at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryStatic(CachingDataFactory.java:181)
 [java]     at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStaticInternal(CompoundDataFactory.java:200)
 [java]     at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:182)
 [java]     at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:69)
 [java]     at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performQueryData(DefaultFlowController.java:296)
 [java]     at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performQuery(DefaultFlowController.java:217)
 [java]     at org.pentaho.reporting.engine.classic.core.states.process.ProcessState.initializeForMasterReport(ProcessState.java:331)
 [java]     at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.prepareReportProcessing(AbstractReportProcessor.java:481)
 [java]     at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.processReport(AbstractReportProcessor.java:1713)
 [java]     at org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil.createPDF(PdfReportUtil.java:130)
 [java]     at com.willowit.reporting.PentahoRenderer.renderReport(PentahoRenderer.java:255)
 [java]     at com.willowit.reporting.PentahoRenderer.execute(PentahoRenderer.java:427)
 [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [java]     at java.lang.reflect.Method.invoke(Method.java:497)
 [java]     at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)
 [java]     at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106)
 [java]     at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
 [java]     at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
 [java]     at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
 [java]     at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)
 [java]     at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)
 [java] Caused by: java.lang.Exception: Incorrect username and/or password.  Login Failed.
 [java]     at com.debortoliwines.openerp.api.Session.startSession(Session.java:142)
 [java]     at com.debortoliwines.openerp.reporting.di.OpenERPHelper.getSession(OpenERPHelper.java:401)
 [java]     at com.debortoliwines.openerp.reporting.di.OpenERPHelper.getData(OpenERPHelper.java:86)
 [java]     at org.pentaho.reporting.engine.classic.extensions.datasources.openerp.OpenERPDataFactory.queryData(OpenERPDataFactory.java:197)
 [java]     ... 26 more
 [java] 

On Odoo side:

2015-08-09 10:29:38,024 5980 ERROR illingen openerp.service.report: Exception: <Fault 0: 'Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: Incorrect username and/or password. Login Failed.'>
Traceback (most recent call last):
File "/home/odoo/git/myodoo-server/openerp/service/report.py", line 93, in go
result, format = openerp.report.render_report(cr, uid, ids, object, datas, context)
File "/home/odoo/git/myodoo-server/openerp/report/init.py", line 40, in render_report
return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context)
File "/home/odoo/git/myodoo-server/openerp/api.py", line 241, in wrapper
return old_api(self, _args, _kwargs)
File "/home/odoo/git/myodoo-server/openerp/addons/base/ir/ir_actions.py", line 155, in render_report
return new_report.create(cr, uid, res_ids, data, context)
File "/home/odoo/git/odoo-tools/pentaho_reports/core.py", line 253, in create
rendered_report, output_type = report_instance.execute()
File "/home/odoo/git/odoo-tools/pentaho_reports/core.py", line 196, in execute
return self.execute_report()
File "/home/odoo/git/odoo-tools/pentaho_reports/core.py", line 232, in execute_report
rendered_report = proxy.report.execute(proxy_argument).data
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in call
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1591, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 794, in close
raise Fault(
_self._stack[0])
Fault: <Fault 0: 'Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: Incorrect username and/or password. Login Failed.'>
2015-08-09 10:29:38,185 5980 ERROR illingen openerp.addons.web.controllers.main: An exception occured during an http request
Traceback (most recent call last):
File "/home/odoo/git/myodoo-server/addons/web/controllers/main.py", line 70, in wrap
return f(_args, **kwargs)
File "/home/odoo/git/myodoo-server/addons/web/controllers/main.py", line 1576, in index
request.session.db, request.session.uid, request.session.password, report_id)
File "/home/odoo/git/myodoo-server/openerp/http.py", line 879, in proxy_method
result = dispatch_rpc(self.service_name, method, args)
File "/home/odoo/git/myodoo-server/openerp/http.py", line 115, in dispatch_rpc
result = dispatch(method, params)
File "/home/odoo/git/myodoo-server/openerp/service/report.py", line 34, in dispatch
res = fn(db, uid, *params)
File "/home/odoo/git/myodoo-server/openerp/service/report.py", line 141, in exp_report_get
return _check_report(report_id)
File "/home/odoo/git/myodoo-server/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: Incorrect username and/or password. Login Failed.'>, <traceback object at 0x7fc670f65a70>))

@richard-willdooit
Copy link
Contributor

@eqms

I point out: "Incorrect username and/or password. Login Failed."

Petaho needs to log in and create a session based on the current user. This code went through an overhaul on Friday, again, due to the complex nature of the co-interaction.

How recently did you pull the connector source?

If it is since Friday, could you try this all on a database with password encryption turned off? We have been running with version 5.4 for a little while now, without issue, with object based reports. Our pre-built war file runs that.

If you are still having problems, can you put some de-bug code in to the _login method in core_newapi.py and see what username and password Pentaho is actually attempting to authenticate with?

Richard

@dntq83
Copy link

dntq83 commented Aug 10, 2015

Did you install module "auth_crypt"?

@eqms
Copy link
Author

eqms commented Aug 10, 2015

I tried with auth_crypt. It doesn't worked.
Without it works. Is there no workaround with auth_crypt?

Another question: If I ant a direct relationship between a dataset in Odoo and the report, do I need to create a module for this? How can I commit my Odoo filters to the report?

Thanks from Germany.
Martin

@richard-willdooit
Copy link
Contributor

@eqms - No, there is currently no workaround without auth-crypt - the workaround would be (at this point) to store the user's password somewhere else in clear-text - that would allow the Pentaho connector to pick up the user's password to pass out to Pentaho itself, so it can use that to authenticate.

At this point in time, we do not have the time or resources to provide a proper work-around, and rather than issuing a version that will have to be retracted, you may need to provide your own extension module to store and retrieve the clear-text password, or change the installation to remove the auth_crypt.

Sorry, for the moment, unless I have a brain-wave in the next few days...

I am not sure what you mean by the rest of your question? Could you elaborate a bit, and perhaps post it as a new issue so it may be helpful to others searching for answers.

@eqms
Copy link
Author

eqms commented Aug 10, 2015

Thank you for your help. After I set the password manually uncrypted, it works. But after -u all -d db Odoo will delete the uncrypted password. So I will search for a way the use the crypted password.

I will inform you if I find a way to do this.

Forget the second question. I set a filter in the query. So the selected dataset of Odoo doesn't work.

Best regards from Germany.

@richard-willdooit
Copy link
Contributor

@eqms - If you go to the list of installed modules, and uninstall the encryption module, (auth_crypt) it will stay uninstalled when you upgrade. (You will need to put an unencrypted password in directly using psql or pg_admin)

I really would like a solution, so keep me informed. I am starting a new issue for discussion and input... Please follow there... (Issue #219)

@richard-willdooit
Copy link
Contributor

@eqms - The latest version should overcome the issue and work with password encryption. There is a module (pentaho_reports_auth_crypt) which should auto install if encryption is turned on. (However, it will not for existing dbs so you may need to install it now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants