Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


SOLVED Test packaging the Invoice Ninja app, running into issues.


  • Sorry for my total newbie question, but was considering testing with Invoice Ninja v5 to package, but before I got that far wanted to test with the exact same package from Cloudron's Invoice Ninja package for v4, and to test the process out with the instructions found here: https://forum.cloudron.io/topic/3102/building-custom-packages

    I've done the following steps:

    1. Installed Cloudron Build service
    2. sudo git clone https://git.cloudron.io/cloudron/invoiceninja-app.git
    3. cd invoiceninja-app
    4. cloudron build where I then answer with d19dotca/cloudron-invoiceninja-app as the Docker Hub repository.

    But at this point, it fails with the following in the CLI:

    - Installing alfaproject/omnipay-skrill (dev-master f90a185): Cloning f90a185b5e
    
    In Git.php line 325:
                                                                                   
      Failed to clone https://github.com/xcaliber-tech/omnipay-skrill.git via htt  
      ps, ssh protocols, aborting.                                                 
                                                                                   
      - https://github.com/xcaliber-tech/omnipay-skrill.git                        
        Cloning into '/app/code/vendor/alfaproject/omnipay-skrill'...              
        fatal: could not read Username for 'https://github.com': No such device o  
      r address                                                                    
                                                                                   
      - git@github.com:xcaliber-tech/omnipay-skrill.git                            
        Cloning into '/app/code/vendor/alfaproject/omnipay-skrill'...              
        Could not create directory '/var/www/.ssh'.                                
        Host key verification failed.                                              
        fatal: Could not read from remote repository.                              
                                                                                   
        Please make sure you have the correct access rights                        
        and the repository exists.                                                 
                                                                                   
    
    install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
    
    The command '/bin/bash -c curl -SL https://github.com/hillelcoren/invoice-ninja/archive/v${VERSION}.tar.gz | tar -zxvf - -C /app/code --strip-components=1     && chown -R www-data:www-data /app/code     && sudo -u www-data composer install --working-dir=/app/code --no-dev --no-interaction --no-progress     && sudo -u www-data composer dump-autoload --working-dir=/app/code --optimize --no-interaction     && sudo -u www-data php /app/code/artisan optimize --force --no-interaction --verbose     && mv /app/code/storage /app/code/storage-vanilla && ln -s /app/data/storage /app/code/storage     && rm -rf /app/code/bootstrap/cache && ln -s /run/invoiceninja/bootstrap-cache /app/code/bootstrap/cache     && mv /app/code/public/logo /app/code/public-logo-vanilla && ln -s /app/data/public/logo /app/code/public/logo     && ln -s /app/data/env /app/code/.env     && rm -rf /app/code/docs' returned a non-zero code: 1
    

    I'm so confused as to why this would fail though, when this is just the exact package from Cloudron's Invoice Ninja package, no changes made to it at all. I did this test because I thought it'd work without issues and allow me to just validate the process itself, but to my surprise running into errors "returned a non-zero code: 1" message.

    Did I totally miss something in my testing? Am I misunderstanding something about the packaging process?

    Btw, if it matters, I'm running the commands via the built-in Terminal app on macOS Big Sur.

  • Staff

    What you see seems to be a build issue, it should work and does for me here. Is this happening every time for you?

    On a side note, you likely don't have to do a repo git clone with sudo but I am not a mac user, still that sounds strange.

    Also in order to make cloudron build use your build bot installed on your Cloudron, first run it with cloudron build --set-build-service once, otherwise it would build on your mac, which may be causing the issue you are seeing.


  • @nebulon said in Test packaging the Invoice Ninja app, running into issues.:

    On a side note, you likely don't have to do a repo git clone with sudo but I am not a mac user, still that sounds strange.

    Mac user here. No need for sudo in cloning but it won’t hurt anything, of course. ☺️


  • @nebulon I had set the set-build-service a while back, it's still active and works. It logs in and everything when I tried re-setting it again though, so all seems well on that front. I don't think it's building it on the mac itself but on the Cloudron Build service.

    The issue it's complaining about in the error output though is running the command from the Dockerfile, everything before it works okay, so is that still a Cloudron Build issue? I assumed that was me doing something wrong in packaging. And if it works fine for you following the same steps I wrote above, then I assume it's something unique to me. haha. Just not sure what yet though as I followed all the steps documented in the other post.

    @Lonk - Interesting, because I had to use sudo or else it failed right away. I'll look into that again though. Maybe I need to grant myself more access to my macOS user account.


  • @d19dotca said in Test packaging the Invoice Ninja app, running into issues.:

    Interesting, because I had to use sudo or else it failed right away. I'll look into that again though. Maybe I need to grant myself more access to my macOS user account.

    You know, I'm actually still on Mojave so things could have changed, become more write protected and it maybe needs sudo for some kind of weird permission issue when cloning (I'm surprised, but security is good I suppose πŸ˜‚).

  • Staff

    @d19dotca Can you try another app, just to check if the issue is something else?


  • @girish Sounds like a good idea! I'll package another one using the steps above but different app package, and see how it goes. Will probably do that later today.


  • @Lonk - Just FYI, without using sudo I get this permission denied:
    warning: unable to access '/Users/<username>/.config/git/attributes': Permission denied

    Not to distract from the original conversation though. haha. I'm just in the middle of testing with a new app to see if I get a similar issue.


  • @girish I just tried this with the Bitwarden app and the cloudron build command almost completed without issues, but it failed at unauthorized: please use personal access token to login which seems like a very different Docker issue that's unrelated to the package itself. So now I'm doubly confused, lol. Why did it fail for Invoice Ninja at the packaging level but didn't for Bitwarden, any ideas? I tried creating a new folder and running the commands in there too just in case of some bizarre permission issue or something, but same issue I ran into yesterday for Invoice Ninja.

    UPDATE: Fixed the unauthorized: please use personal access token to login by using a personal access token in the docker.json file in Cloudron Build service, now it's built completely and you can find it here: https://hub.docker.com/r/d19dotca/cloudron-bitwarden-app

    So... why would Bitwarden work but not Invoice Ninja for me, using the exact same commands only difference of course if the git repository URL in git clone itself?

    To clarify, the current output on invoice ninja is the same as before:

      - Installing alfaproject/omnipay-skrill (dev-master f90a185): Downloading    Failed to download alfaproject/omnipay-skrill from dist: The "https://api.github.com/repos/xcaliber-tech/omnipay-skrill/zipball/f90a185b5e26fb5b4150d664f01ad8048b460bcf" file could not be downloaded (HTTP/1.1 404 Not Found)
        Now trying to download from source
      - Installing alfaproject/omnipay-skrill (dev-master f90a185): Cloning f90a185b5e
    
    In Git.php line 325:
                                                                                   
      Failed to clone https://github.com/xcaliber-tech/omnipay-skrill.git via htt  
      ps, ssh protocols, aborting.                                                 
                                                                                   
      - https://github.com/xcaliber-tech/omnipay-skrill.git                        
        Cloning into '/app/code/vendor/alfaproject/omnipay-skrill'...              
        fatal: could not read Username for 'https://github.com': No such device o  
      r address                                                                    
                                                                                   
      - git@github.com:xcaliber-tech/omnipay-skrill.git                            
        Cloning into '/app/code/vendor/alfaproject/omnipay-skrill'...              
        Could not create directory '/var/www/.ssh'.                                
        Host key verification failed.                                              
        fatal: Could not read from remote repository.                              
                                                                                   
        Please make sure you have the correct access rights                        
        and the repository exists.                                                 
                                                                                   
    
    install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
    
    The command '/bin/bash -c curl -SL https://github.com/hillelcoren/invoice-ninja/archive/v${VERSION}.tar.gz | tar -zxvf - -C /app/code --strip-components=1     && chown -R www-data:www-data /app/code     && sudo -u www-data composer install --working-dir=/app/code --no-dev --no-interaction --no-progress     && sudo -u www-data composer dump-autoload --working-dir=/app/code --optimize --no-interaction     && sudo -u www-data php /app/code/artisan optimize --force --no-interaction --verbose     && mv /app/code/storage /app/code/storage-vanilla && ln -s /app/data/storage /app/code/storage     && rm -rf /app/code/bootstrap/cache && ln -s /run/invoiceninja/bootstrap-cache /app/code/bootstrap/cache     && mv /app/code/public/logo /app/code/public-logo-vanilla && ln -s /app/data/public/logo /app/code/public/logo     && ln -s /app/data/env /app/code/.env     && rm -rf /app/code/docs' returned a non-zero code: 1
    Failed to build app. See log output above.
    
  • Staff

    At least we know now that it is not because of some buildbot / dev machine setup as such if other apps can be built.

    And I just built invoice ninja without build cache and can also reproduce the issue.

    Apparently some of the project dependencies are now failing during php composer install πŸ˜• Sad story when upstream projects don't have a community to maintain it.

    Will see what needs to be fixed, but for this thread, your setup seems to be all fine.

  • Staff

    I've logged an upstream issue about the broken dependency at https://github.com/invoiceninja/invoiceninja/issues/4199

  • Staff

    I've pushed a fix to the app package repo. So this should also now succeed for you.


  • @nebulon Oh that's perfect, thank you so much for looking into that! Happy to hear it wasn't just me then, haha, just bad luck with the app and timing I guess, glad to know the process I was trying to test works though. Thanks again for the help! πŸ™‚