Jasperreports_odoo icon indicating copy to clipboard operation
Jasperreports_odoo copied to clipboard

Permission error

Open docimin opened this issue 2 years ago • 15 comments

Hello! I seem to be having issue with the reporting module, and whatever I do, i keep getting this error. How or where do i fix this?

  File "/opt/odoo/odoo-server/odoo/http.py", line 835, in dispatch
    r = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/odoo/service/model.py", line 98, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/custom/addons/jasper_reports/controllers/main.py", line 58, in report_routes
    context).render_jasper(docids, data=data)
  File "/opt/odoo/custom/addons/jasper_reports/models/report_xml.py", line 186, in render_jasper
    jasper = r.execute()
  File "/opt/odoo/custom/addons/jasper_reports/JasperReports/jasper_report_config.py", line 174, in execute
    data_file, output_file, sub_report_data_files)
  File "/opt/odoo/custom/addons/jasper_reports/JasperReports/jasper_report_config.py", line 260, in execute_report
    connection_parameters, self.report_path, output_file, parameters)
  File "/opt/odoo/custom/addons/jasper_reports/JasperReports/jasper_server.py", line 115, in execute
    self.start()
  File "/opt/odoo/custom/addons/jasper_reports/JasperReports/jasper_server.py", line 105, in start
    with open(self.pidfile, 'w') as f:
PermissionError: [Errno 13] Permission denied: 'odoo-jasper.pid'

docimin avatar Apr 22 '22 07:04 docimin

@hiren-serpentcs

JayVora-SerpentCS avatar May 17 '22 14:05 JayVora-SerpentCS

@docimin

You need to give the write permission to the jasper_reports module

hiren-serpentcs avatar May 19 '22 09:05 hiren-serpentcs

Hey @hiren-serpentcs, thank you, but do you mean with CHMOD 775 for example? Or where exactly? Linux side or Odoo side?

docimin avatar May 24 '22 22:05 docimin

@docimin From the Linux side, you need to give the 777 permission (chmod 777 <PATH TO MODULE>/jasper_reports).

hiren-serpentcs avatar May 30 '22 09:05 hiren-serpentcs

Hey @hiren-serpentcs, i have done this, still will not work.

For reference, the .jrxml is completely empty and has nothing in it. And it does not even print out a blank page, just gives an "invisible error" instead

image image

docimin avatar Jun 08 '22 07:06 docimin

Hello, we are getting this error message also, we have tried to giove permission to the files, the folder, reassing then to the odoo group but still get the same message, please help us, this is generating a lot of pressure from customers, Thank you Jay for your sharing this!!

sfeterman avatar May 08 '23 20:05 sfeterman

Hi, sorry about the insistence on this issue, but we have now a lot of reports that were working and now are not. How can we get help on this issue? Thanks

sfeterman avatar May 11 '23 01:05 sfeterman

hi, also got the same problem, 777 permissions were given but does not work

rmcasado avatar Oct 19 '23 23:10 rmcasado

im also facing this issue, any help? @hiren-serpentcs

baydevincent avatar Oct 21 '23 03:10 baydevincent

@rmcasado i solve this by create odoo-jasper.pid at another folder and give it permission (sudo chmod 777 /[PATH]/odoo-jasper.pid) and then edit your odoo config file and add this to your line

jasperpid = /[Your PATH]/odoo-jasper.pid

baydevincent avatar Oct 21 '23 05:10 baydevincent

@baydevincent thanks !!!! Now I got a connection error :(

odoo.addons.jasper_reports.JasperReports.jasper_server: EXCEPTION: [Errno 111] Connection refused (111, 'Connection refused')

rmcasado avatar Oct 23 '23 16:10 rmcasado

@rmcasado i got the same issue, i trying to solve that or maybe you can post that as new issue

baydevincent avatar Oct 24 '23 01:10 baydevincent

@baydevincent finally found the problem, java directory was not right copied, only java classes in com and nothing in lib, after copied could run my reports again

rmcasado avatar Oct 25 '23 00:10 rmcasado

@rmcasado may i ask what java version do you use? because i still got the refused issue

baydevincent avatar Oct 25 '23 07:10 baydevincent

@baydevincent

Hi, my configuraion :

  • Ubuntu 20.04.6 LTS
  • Odoo 14
  • Python 3.9
  • Java 11 - /usr/lib/jvm/java-11-amazon-corretto Also works with /jasper_reports/java

image

chmod 777 -R /jasper_reports

  • odoo14.conf server_wide_modules = base,web,jasper_load jasperpid=/jasper_reports/JasperReports/odoo-jasper.pid

chmod 777 /jasper_reports/JasperReports/odoo-jasper.pid

Modified jasper_server to use jasperpid #with open(self.pidfile, 'w') as f: with open(os.path.join(self.path(), self.pidfile), 'w') as f:

rmcasado avatar Oct 25 '23 16:10 rmcasado