cloudron build fais with error: Failed to upload app for building: 400 message: accessToken is missing
-
Ah I think the docs/appui are outdated a bit here. If you run
cloudron build --help
it will show:--build-token, --build-service-token <token> Build service token --url, --set-build-service [buildservice url] Set build service URL. This build service is automatically used for future calls from this project
So the arguments are called slightly differently than what you pasted.
-
-
Thank very much, it runs with the correct command, but at the end of the build I have the error:
unauthorized: incorrect username or passwordI'm logged on the cli and a have entered the user name and password on the docker.json file in the build service
-
You are on the right path at least, the error indicates that the build service app does not have valid credentials to push to the specified registry. Maybe also check the image ID you are building, if that may contain some other domain to push to. Also check the logs of the build service app and just to make sure, have you restarted the build service app after changing the docker.json?
-
I restarted it and still the problem.
Looking at the logs I can see the error is intact when pushing the image to the registry:Build stream finished
Pushing...
failed during image pushing.
Push failedMy docker.json file looks like this:
{
"docker.io": {
"username": "?????",
"password": "?????"
}
}Is there any configuration I might be missing, perhaps in the Registry app?
-
Same thing
-
I am a bit out of ideas now. Since the build service uses the host docker instance, you could also see if you can SSH into the server and attempt a
docker push ....
of those images there. Also check if the images are known locally, which they should usingdocker images
. Just to narrow down potential issues. -
Well. That another problem. The host terminal doesn't work for me
-
Not that. But there is a terminal you can access fort the app config page that doesn't work for me. I'll try ssh
-
Can you give me the basics or point me to documentation to connect with ssh?
-
Not quite sure where to start then. Your server provider will likely have information on how to connect via SSH, most likely you were connected via SSH during Cloudron installation. If you hadn't done that yourself, maybe ask that person?
For clarification the webterminal from the app config page is only a terminal into the app itself (its docker container) given that the previous test was about the docker host instance, SSH would be useful.
-
@nebulon Just jump into the conversation as @Daniel-Lobo is my dev. I installed Cloudron on the server and now we are trying to add a custom app to the platform.
I see that the issue seem to be with Docker registry credentials so I logged to the server via SSH and tried to log in with the same credentials as set in our docker.json file and that worked. see below:
<logs>
root@my:~# docker login
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/Username: xxxxxx
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded
</logs>I tried to ask AI why the credentials weren't working then and it answered me the correct JSON format is the following:
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "base64-encoded-username-and-password"
}
}
}See ChatGPT chat here: https://chatgpt.com/share/6747192b-ee7c-8005-b402-79b3aac2ef2d
So at this point, is it the format recommended in the Cloudron documentation that is wrong or this format is for Cloudron only and you convert internally to correct JSON structure for docker?
-
I think we lost track here. All I was trying to suggest to check host docker instance (which is used via a docker proxy from the build service) if the image exists and if you can push the image from the host. So firstly does that work?
The credentials format and file in the build service app are not the docker configs, but configs for the build service, as such what @Daniel-Lobo had already posted is correct for that.
-
The credentials on the docker.json file are my cloudron's credentials right? Or docker's?
-
So the
/app/data/docker.json
which resides within the build service app instance, can contain one or many credentials of the docker registries images can be pushed to, if those are private in the first place. https://docs.cloudron.io/apps/docker-builder/#private-registry-authGiven that the error was during image pushing, I guessed the image was built locally fine and only the pushing to the registry failed. So first thing to ensure is the that the image id points to the correct registry and also setup credentials for that. If you use dockerhub then you have to specify the dockerhub credentials here.
All in all you should only ever need to configure things within the app. The mention of the host docker instance was only to narrow down the issue as we didn't seem to get anywhere.
-
The images are build, but not pushed. We have the registry app. Our intention is to push to the registry app. With my cloudron's credentials the error was "unauthorized: incorrect username or password". With the docker credentials the error is "denied: requested access to the resource is denied"
-
Ok so you do not want to even push to the dockerhub? Then you should specify the custom registry instead of
docker.io
in thedocker.json
file with the credentials of that custom registry. Also note that the image repository for that app should then point to the correct registry. You can runcloudron build --set-repository
and it will show an example string likeregistry/username/com.test.cloudronapp
here make sure theregistry
bit is set (otherwise docker falls back to docker.io)