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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Building custom app - authentication problem

Building custom app - authentication problem

Scheduled Pinned Locked Moved App Packaging & Development
33 Posts 5 Posters 2.7k Views 6 Watching
  • 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.
  • E Offline
    E Offline
    ekevu123
    wrote on last edited by
    #15

    I know where it breaks, when downloading the python requirements. But I found the issue - apparently, you can not do that when being on VPN.

    Now I get this error message in the end:
    error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"
    Failed to push image (are you logged in? if not, use "docker login")

    However, I am logged in (I ran "docker login" right before executing "cloudron build").

    1 Reply Last reply
    0
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #16

      @ekevu123 That's good progress! Not sure where you are pushing to, did you set the right image name ? You can try cloudron build --set-repository. Here, you should enter something like ekevu123/appname (where ekevu123 is your docker hub username and appname is the repository).

      1 Reply Last reply
      0
      • E Offline
        E Offline
        ekevu123
        wrote on last edited by
        #17

        Thank you very much, we are getting somewhere!

        I got to run "cloudron install --image" after building the docker successfully. But I ran into another particular problem.

        Firstly, when running the command, I got this error message:
        App installation error: Installation failed: Unable to pull image PATH. message: (HTTP code 404) unexpected - pull access denied for PATH, repository does not exist or may require 'docker login': denied: requested access to the resource is denied statusCode: 404

        So, I made sure I was logged in.

        Secondly, I tried to run the command again and got this:
        Failed to install app: 409 message: primary location 'PATH' is in use
        (I could probably just specify a new path, it's not critical, but to keep it clean it would be great to know how to delete the failed attempt)

        However, the Cloudron dashboard doesnt load anymore. It stays grey. If I try to log in in another browser, I get to the login mask, after putting in my details, I just see a grey screen. Fortunately, apps seem to work still, I can access them separately.

        Independently of the actual docker error, that is an odd behaviour. I'll try to go through the tutorial for how to save cloudron next unless I see something specific in this thread.

        1 Reply Last reply
        0
        • nebulonN Offline
          nebulonN Offline
          nebulon
          Staff
          wrote on last edited by
          #18

          Then for a start lets get your Cloudron itself working. Do you see any errors in the browser logs or at /home/yellowtent/platformdata/logs/box.log ?

          1 Reply Last reply
          0
          • E Offline
            E Offline
            ekevu123
            wrote on last edited by
            #19

            The "unresponsive" app is new, perhaps that could cause it?
            The 3 stopped apps are okay, that's intended.

            2023-05-12T11:46:30.103Z box:apphealthmonitor app health: 3 running / 3 stopped / 1 unresponsive

            1 Reply Last reply
            0
            • E Offline
              E Offline
              ekevu123
              wrote on last edited by ekevu123
              #20

              My idea was now to use
              "cloudron stop --app NAME"
              using Cloudron CLI

              but it says
              "Failed to stop app: 409 message: Not allowed in error state"

              But this worked:
              "cloudron uninstall --app NAME"

              So, I got access to the dashboard again.

              1 Reply Last reply
              0
              • nebulonN Offline
                nebulonN Offline
                nebulon
                Staff
                wrote on last edited by
                #21

                hm so the app was in error state and thus stopping it was blocked, that is to be expected. However it should certainly not bring down the whole dashboard.

                1 Reply Last reply
                1
                • E Offline
                  E Offline
                  ekevu123
                  wrote on last edited by
                  #22

                  Yep, I agree, but it did - and uninstalling the app via CLI immediately solved it.

                  timconsidineT 1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    ekevu123
                    wrote on last edited by ekevu123
                    #23

                    What's the best way to specify the docker image tag if I don't do this in the Cloudron Manifest or the Dockerfile?

                    EDIT: --tag did that

                    1 Reply Last reply
                    0
                    • E ekevu123

                      Yep, I agree, but it did - and uninstalling the app via CLI immediately solved it.

                      timconsidineT Offline
                      timconsidineT Offline
                      timconsidine
                      App Dev
                      wrote on last edited by
                      #24

                      @ekevu123 said in Building custom app - authentication problem:

                      and uninstalling the app via CLI immediately solved it.

                      FWIW when I am building a custom app and I make changes to the Dockerfile, it is my standard process to uninstall the last app version before seeking to build and deploy the next version.
                      Technically this might be unnecessary, but for my little brain, I find it easier to know that I am starting 'clean'.
                      I usually uninstall via the app's settings screen, but I guess from CLI is same and might be easier if you're working on command line anyway.

                      I also use a little script cld.sh (call it whatever you want, I save keystrokes where possible) :

                      #/bin/bash
                      docker build --no-cache -t $1 .
                      docker push $1
                      cloudron install --image $1
                      

                      and I run this it this : ./cld.sh <repository_url>/<app_name>:<tag>
                      I hack my way through multiple trial-and-error builds, and this saves a lot of time, keystrokes and typos.

                      Maybe you have your own workflow efficiencies 😄

                      1 Reply Last reply
                      2
                      • E Offline
                        E Offline
                        ekevu123
                        wrote on last edited by
                        #25

                        I would probably do the same, but it doesn't help me in this case, because I am not overriding an existing installation. Instead, I just get a faulty installation in the first place.

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          ekevu123
                          wrote on last edited by
                          #26

                          To summarise, my issue is this. When running "cloudron build", I get this error:

                          error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"
                          Failed to push image (are you logged in? if not, use "docker login")

                          But I ran docker login before this step. I completely deleted all Cloudron CLI configuration and re-installed it without any effect.

                          1 Reply Last reply
                          0
                          • girishG Offline
                            girishG Offline
                            girish
                            Staff
                            wrote on last edited by
                            #27

                            @ekevu123 I would first check if docker push works? Can you confirm ?

                            I also found two related links:

                            • https://superuser.com/questions/1389039/docker-error-parsing-http-403-response-body-invalid-character-looking-for says this might be cause docker push access does not work from network
                            • https://stackoverflow.com/questions/32900830/docker-http-code-403-while-uploading-metadata-invalid-character-looking-f says it's maybe an auth issue with docker hub
                            1 Reply Last reply
                            0
                            • E Offline
                              E Offline
                              ekevu123
                              wrote on last edited by
                              #28

                              No, I am getting the issue when running docker push.

                              I also suspect that it is an IP restriction because I am currently in Malaysia. So, I contacted Docker support about it. The only other solution I could think of then would be to change the docker repo provider to Google or something.

                              1 Reply Last reply
                              0
                              • E Offline
                                E Offline
                                ekevu123
                                wrote on last edited by ekevu123
                                #29

                                Docker pull and docker push works fine now and docker didn't confirm any IP restriction.

                                I could now build the app using cloudron build but I am getting this when I am trying to install it:
                                App installation error: Installation failed: Unable to pull image PATH:tag. message: (HTTP code 404) unexpected - pull access denied for PATH, repository does not exist or may require 'docker login': denied: requested access to the resource is denied statusCode: 404

                                But the path is right, I used --set-repository to check and it's the same I use for docker pull and docker push.

                                Is it possible that for whatever reason Cloudron cannot authenticate with Docker in my case?

                                EDIT: It works when making the repository public.

                                BrutalBirdieB 1 Reply Last reply
                                0
                                • E ekevu123

                                  Docker pull and docker push works fine now and docker didn't confirm any IP restriction.

                                  I could now build the app using cloudron build but I am getting this when I am trying to install it:
                                  App installation error: Installation failed: Unable to pull image PATH:tag. message: (HTTP code 404) unexpected - pull access denied for PATH, repository does not exist or may require 'docker login': denied: requested access to the resource is denied statusCode: 404

                                  But the path is right, I used --set-repository to check and it's the same I use for docker pull and docker push.

                                  Is it possible that for whatever reason Cloudron cannot authenticate with Docker in my case?

                                  EDIT: It works when making the repository public.

                                  BrutalBirdieB Offline
                                  BrutalBirdieB Offline
                                  BrutalBirdie
                                  Partner
                                  wrote on last edited by
                                  #30

                                  @ekevu123
                                  https://docs.cloudron.io/settings/#private-docker-registry

                                  Did you take this into account?

                                  Like my work? Consider donating a drink. Cheers!

                                  1 Reply Last reply
                                  1
                                  • E Offline
                                    E Offline
                                    ekevu123
                                    wrote on last edited by
                                    #31

                                    Yes, I did.

                                    I corrected some other errors and finally got the message "app is installed" at some point without any error message. However, once that is the case, I cannot access the dashboard anymore (it stays grey, see above) until I uninstall the app.

                                    Maybe that is a support case after all where you ssh into my instance?

                                    1 Reply Last reply
                                    0
                                    • girishG Offline
                                      girishG Offline
                                      girish
                                      Staff
                                      wrote on last edited by
                                      #32

                                      @ekevu123 If installing a custom image is bringing down the dashboard, that is something we would want to look at. Can you please reach out at support@cloudron.io, interested to see what's going on.

                                      1 Reply Last reply
                                      0
                                      • girishG Offline
                                        girishG Offline
                                        girish
                                        Staff
                                        wrote on last edited by
                                        #33

                                        @ekevu123 Thanks for the report! There was indeed a bug that the dashboard code throws an error when an app does not use any addons. https://git.cloudron.io/cloudron/box/-/commit/e02f3d70649c75c64e4126f1deea45b3456277a0 is the fix.

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • Bookmarks
                                        • Search