Search code examples
permissionspentahopentaho-spoonpentaho-data-integration

PDI - Microsoft Excel Writer - Permission denied


I'm using PDI to generate a Excel.xslx file in a folder using Microsoft Excel Writer component and I'm trying to read this file from a microservice. The problem is I can't read because the file is with permissions: -rw-r-----. How can I write the file with permissions to everyone or how can I change this permissions in PDI?


Solution

  • I created an user "pentaho", put the service to run in the same docker and with the same user.

    Dockerfile Pentaho:

    ...
    
    RUN cd /pentaho && \
      rm /pentaho/*server*/promptuser.sh; \
      sed -i -e 's/\(exec ".*"\) start/\1 run/' /pentaho/*server*/tomcat/bin/startup.sh; \
      mkdir /home/pentaho && groupadd -r pentaho && useradd -r -g pentaho -p $(perl -e'print crypt("pentaho", "aa")' ) -G sudo pentaho && \ 
      chown -R pentaho.pentaho /pentaho && \ 
      chown -R pentaho.pentaho /home/pentaho
    
    WORKDIR /pentaho
    USER pentaho
    
    
    EXPOSE 8080
    
    

    Dockerfile App:

    FROM    company/pentaho:1.0.0
    MAINTAINER  Company
    
    ADD start_scripts/run.sh /pentaho/
    
    ...
    RUN sudo chown -R pentaho.pentaho /pentaho/pentaho-server
    
    WORKDIR /pentaho
    USER pentaho
    
    
    EXPOSE 8080
    
    # 1. Run 
    
    ENTRYPOINT ["bash", "/pentaho/run.sh"]
    
    

    Run.sh:

    if [ -z "$DEBUG" ]; then
      echo Starting Sheet Formatting service and Pentaho in DEBUG mode
      cd /pentaho/
      java -jar sheet-service.jar & 
      cd *server*
      ./start-pentaho.sh;
    else
      echo Starting Sheet Formatting service and Pentaho in normal mode
      cd /pentaho/
      java -jar sheet-service.jar &
      cd *server*
      ./start-pentaho-debug.sh;
    fi