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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved starting container process caused: exec: "/app/code/start.sh": permission denied: unknown

    Help Wanted or Offered
    3
    20
    2404
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rmdes
      rmdes last edited by rmdes

      I have followed other python app idea for now to try to package Tanzawa
      my build seem to be ok locally but when I push & install with cloudron cli
      I'm getting starting container process caused: Bad Field: (HTTP code 400) unexpected - OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/app/code/start.sh": permission denied: unknown

      It seems to be a permission error because start . sh is where it is expected inside the container
      I tried with /app/pkg/start.sh and /app/code/start.sh

      I have my Dockerfile & start . sh here : https://paste.armada.digital/ogoxofadex.yaml
      someone from the app makers can have a look ?

      • by default tanzawa use sqlite3, i'm not trying to change that for a first package
      • only addon is localstorage, to have backup /app/data (cloudron manifest)
      • I have doubts about the path I have to use launch the python server (see end of the start . sh)
      • there is a createsuperuser python3 command to do manually, I'm okay with that for a first version
      • it seems my .env.sample is not being carried out because when I go inside the cloudron container (before this error blocked everything) the .env file was always empty
      timconsidine 3 Replies Last reply Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        @rmdes so the start.sh need to have the exec bit set. You can either do this in the app package folder itself and commit this to git, like on your laptop do chmod +x start.sh or you do this in the Dockerfile. Both works, however doing it in the Dockerfile adds another rather unnecessary image layer.

        rmdes timconsidine 2 Replies Last reply Reply Quote 1
        • timconsidine
          timconsidine App Dev @rmdes last edited by

          @rmdes I use a CHOWN statement to cloudron:cloudron towards the end of my Dockerfile

          Trying to find an example but git.cloudron.io is not responding at the moment.

          1 Reply Last reply Reply Quote 0
          • timconsidine
            timconsidine App Dev @rmdes last edited by timconsidine

            @rmdes try something like this

            RUN chown -R cloudron:cloudron /app/code

            Not guaranteed to fix but no harm trying

            EDIT : Maybe move the CHOWN commands out of start.sh into the Dockerfile ?

            rmdes 1 Reply Last reply Reply Quote 0
            • timconsidine
              timconsidine App Dev @rmdes last edited by

              @rmdes I don't understand this

              COPY start.sh /app/pkg/start.sh
              CMD [ "/app/code/start.sh" ]
              

              They're different locations.

              rmdes 1 Reply Last reply Reply Quote 0
              • rmdes
                rmdes @timconsidine last edited by rmdes

                @timconsidine Yes this was an error when I did the pastebin
                because I tried both ways, using /app/pkg/start sh
                and /app/code/start sh

                timconsidine 1 Reply Last reply Reply Quote 0
                • timconsidine
                  timconsidine App Dev @rmdes last edited by

                  @rmdes ah ok

                  1 Reply Last reply Reply Quote 0
                  • rmdes
                    rmdes @timconsidine last edited by

                    @timconsidine gonna try to do this

                    rmdes 1 Reply Last reply Reply Quote 0
                    • rmdes
                      rmdes @rmdes last edited by

                      Doing the install to cloudron now, let's see if it boots

                      rmdes 1 Reply Last reply Reply Quote 0
                      • rmdes
                        rmdes @rmdes last edited by

                        This is where I am now : https://paste.armada.digital/umomimefek.yaml

                        timconsidine 2 Replies Last reply Reply Quote 0
                        • timconsidine
                          timconsidine App Dev @rmdes last edited by

                          @rmdes but it doesn't boot ?

                          1 Reply Last reply Reply Quote 0
                          • timconsidine
                            timconsidine App Dev @rmdes last edited by

                            @rmdes this may be an ignorant question : I am not a dev and not that familiar with python
                            In your Dockerfile you are using virtualenv
                            I understand this can be important in a system where other processes and apps are running.
                            But conceptually a Docker app is isolated
                            So virtualenv actually needed ?
                            Might it be adding complexity ?

                            rmdes 2 Replies Last reply Reply Quote 0
                            • nebulon
                              nebulon Staff last edited by

                              @rmdes so the start.sh need to have the exec bit set. You can either do this in the app package folder itself and commit this to git, like on your laptop do chmod +x start.sh or you do this in the Dockerfile. Both works, however doing it in the Dockerfile adds another rather unnecessary image layer.

                              rmdes timconsidine 2 Replies Last reply Reply Quote 1
                              • rmdes
                                rmdes @timconsidine last edited by rmdes

                                @timconsidine No worries, me neither 🙂

                                Actually it's quite common see other apps, but I'm not sure about the logic to do it in start sh or Dockerfile, which is the best I mean..

                                Taiga : https://git.cloudron.io/cloudron/taiga-app/-/blob/master/start.sh

                                Other python apps : https://git.cloudron.io/cloudron?filter=python

                                edit : outside cloudron context, I have seen virtualenv or pyenv used in a lot of dockerfiles for python project, so I'm quite confident starting from the original Dockerfile is the way to go 🙂

                                1 Reply Last reply Reply Quote 1
                                • rmdes
                                  rmdes @nebulon last edited by

                                  @nebulon Now that you say it, of course, it's logical that was missing !!
                                  Thank you 🙂

                                  1 Reply Last reply Reply Quote 0
                                  • rmdes
                                    rmdes @timconsidine last edited by

                                    @timconsidine the idea with docker is precisely that, you start from a base image, here provided by cloudron base and from there you build the environnement you need for that particular app, here, based on the requirements.txt like you would do if you wanted to run the app in a virtual machine/docker/container or simply running in your laptop locally, you want this feature so that you can get exactly the required environnement loaded in the docker container, just to run what the original code require, that's how I understand it, but no worries I'm not a dev here, just a passionate learner 🙂

                                    1 Reply Last reply Reply Quote 1
                                    • timconsidine
                                      timconsidine App Dev @nebulon last edited by

                                      @nebulon said in starting container process caused: exec: "/app/code/start.sh": permission denied: unknown:

                                      Both works, however doing it in the Dockerfile adds another rather unnecessary image layer.

                                      That's very interesting, from perspective of someone learning to package.
                                      Thank you

                                      rmdes 1 Reply Last reply Reply Quote 0
                                      • rmdes
                                        rmdes @timconsidine last edited by

                                        I went chmoding the file locally, now it's rebuilding the container, next is to push it to docker hub
                                        then cloudron install

                                        timconsidine rmdes 2 Replies Last reply Reply Quote 0
                                        • timconsidine
                                          timconsidine App Dev @rmdes last edited by

                                          @rmdes I can't stand the suspense 😉

                                          1 Reply Last reply Reply Quote 0
                                          • rmdes
                                            rmdes @rmdes last edited by rmdes

                                            Alright, it's running!

                                            Now I have to take care of env file not being taken into account
                                            and the secret being generated in the Dockerfile not being stored in the .env.sample
                                            hence the app boot, but screaming for an .env & appropriate secret 🙂

                                            timconsidine 1 Reply Last reply Reply Quote 1
                                            • timconsidine
                                              timconsidine App Dev @rmdes last edited by

                                              @rmdes congratulations !

                                              1 Reply Last reply Reply Quote 1
                                              • First post
                                                Last post
                                              Powered by NodeBB