Project

General

Profile

Bug #3441

Errors when downloading files in pentaho 5.3

Added by Dejan Gambin over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Target version:
-
Start date:
2015-05-28
Due date:
% Done:

0%


Description

When downloading from JCR to filesystem, I get all zero bytes files. In catalina.out, there are errors like this for each file:

14:30:25,469 ERROR [FileResource] Export failed: :public:cde:widgets:sample.cda null
java.lang.NullPointerException
at org.pentaho.platform.web.http.api.resources.services.FileService.doGetFileOrDirAsDownload(FileService.java:346)
at org.pentaho.platform.web.http.api.resources.FileResource.doGetFileOrDirAsDownload(FileResource.java:539)
at org.pentaho.reporting.libraries.pensol.JCRSolutionDirectFileModel.getData(JCRSolutionDirectFileModel.java:316)
at org.pentaho.reporting.libraries.pensol.WebSolutionFileObject.doGetInputStream(WebSolutionFileObject.java:186)
at org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(Unknown Source)
at org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(Unknown Source)
at org.apache.commons.vfs.FileUtil.writeContent(Unknown Source)
at org.apache.commons.vfs.FileUtil.copyContent(Unknown Source)
at org.apache.commons.vfs.provider.AbstractFileObject.copyFrom(Unknown Source)
at org.pentaho.di.job.entries.copyfiles.JobEntryCopyFiles.ProcessFileFolder(JobEntryCopyFiles.java:402)
at org.pentaho.di.job.entries.copyfiles.JobEntryCopyFiles.execute(JobEntryCopyFiles.java:290)
at org.pentaho.di.job.Job.execute(Job.java:716)
at org.pentaho.di.job.Job.execute(Job.java:859)
at org.pentaho.di.job.Job.execute(Job.java:859)
at org.pentaho.di.job.Job.execute(Job.java:859)
at org.pentaho.di.job.Job.execute(Job.java:859)
at org.pentaho.di.job.Job.execute(Job.java:598)
at org.pentaho.di.job.entries.job.JobEntryJobRunner.run(JobEntryJobRunner.java:69)
at java.lang.Thread.run(Thread.java:724)
2015/05/28 14:30:25 - Download Files from JCR - ERROR (version 5.3-SNAPSHOT, build 1 from 2015-05-12 15.31.52 by tomcat) : File System Exception: Could not copy "jcr-solution:http://127.0.0.1:8083/pentaho!/public/cde/widgets/sample.cda" to "file:///home/pentaho/cbf/project-5.3/pentaho-solutions/repositorySynchronizer/public/cde/widgets/sample.cda".
2015/05/28 14:30:25 - Download Files from JCR - ERROR (version 5.3-SNAPSHOT, build 1 from 2015-05-12 15.31.52 by tomcat) : Caused by: Unknown message with code "Failed to write file: {0}".

I am using pentaho 5.3 (built with cbf) and PRS 15.02.26 (installed with Marketplace).

NOTES:

- I am using custom port (8083) and noticed that prs.xml was not modified accordingly so I did it manually, but didn't help to solve the problem
- I am using proxy_ajp (if this has any relevance)
- I also put "<entry key="saiku" value-ref="streamConverter"/>" into importExport.xml. no help
- this is all working in pentaho 5.2 but had to modify importExport.xml too for downloading saiku files (but there is PRS 14.12.10)

History

#1 Updated by Carlos Russo over 3 years ago

This seems to be a file system permission issue.
Log into that machine using the same user that the biserver is using and try to create some file in /home/pentaho/cbf/project-5.3/pentaho-solutions/repositorySynchronizer

Example:

echo "yes" > /home/pentaho/cbf/project-5.3/pentaho-solutions/repositorySynchronizer/does_this_work.txt

#2 Updated by Carlos Russo over 3 years ago

  • Status changed from New to Awaiting Feedback

#3 Updated by Dejan Gambin over 3 years ago

BI Server is started as root (there wee some problems in generating some tmp files/folders). But I also tried whit another username (which is the owner of all pentaho stuff), it works normally. So there must be something else :-(

#4 Updated by Carlos Russo over 3 years ago

  • Status changed from Awaiting Feedback to In Progress
  • Priority changed from Normal to Urgent

libpensol is sending userAgent = null and the following test assumes there is always a valid userAgent:

https://github.com/pentaho/pentaho-platform/blob/master/extensions/src/org/pentaho/platform/web/http/api/resources/services/FileService.java#L346

if ( userAgent.contains( "Firefox" ) ) {
// special content-disposition for firefox browser to support utf8-encoded symbols in filename
attachment = "attachment; filename*=UTF-8\'\'" + encodedFileName;
} else {
attachment = "attachment; filename=" + quotedFileName;
}

This is triggered by
https://github.com/marcovala/pentaho-reporting/blob/master/libraries/libpensol/source/org/pentaho/reporting/libraries/pensol/JCRSolutionDirectFileModel.java#L316

response = this.fileRes.doGetFileOrDirAsDownload( null, fileId, "false" );

#5 Updated by Carlos Russo over 3 years ago

  • Status changed from In Progress to Awaiting Feedback

#6 Updated by Dejan Gambin over 3 years ago

Works :-)

#7 Updated by Carlos Russo over 3 years ago

  • Status changed from Awaiting Feedback to Closed

Yeah!

Also available in: Atom PDF