appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 64 forks source link

BYOC Docker: executing "version" at <.Client.Experimental>: can't evaluate field Experimental in type system.clientVersion #3869

Closed jidanfan closed 1 year ago

jidanfan commented 1 year ago

hi I was use BYOC with docker,I use docker cloud type to build job,and docker version is 23.0. but the work job can't start with error: Starting Docker job... template: version:1:44: executing "version" at <.Client.Experimental>: can't evaluate field Experimental in type system.clientVersion I found the reason is when work job start appveyor will call a docker cmd: docker version --format "{{.Client.Version}} {{.Client.Os}} {{.Client.Experimental}} {{.Server.Version}} {{.Server.Os}} {{.Server.Experimental}}" and in docker 23.0,{{Client.Experimental}} featual has been Deprecated . in doc: Docker Engine 23.0 release notes and remove "Experimental" client field from "docker version" Maybe next version you can fix the docker cmd. thanks

FeodorFitsner commented 1 year ago

Here is an updated build of AppVeyor Host Agent for Linux with "experimental" flag removed: https://appveyordownloads.blob.core.windows.net/appveyor/7.0.3269/appveyor-host-agent_7.0.3269_amd64.deb (zip: https://appveyordownloads.blob.core.windows.net/appveyor/7.0.3269/appveyor-host-agent-7.0.3269-linux-x64.tar.gz)

You can try installing updated deb with the command:

sudo bash -c "APPVEYOR_URL={appVeyorUrl} HOST_AUTH_TOKEN={hostAuthorizationToken} dpkg -i <debPath>"

Let me know how that worked. We'll make that package as default then.

jidanfan commented 1 year ago

This build version is not work in my docker(v23.01). I use it to build a image and can't start container:

Creating network "appveyor_default" with the default driver
Creating appveyor_appveyor_1 ... error

ERROR: for appveyor_appveyor_1 Cannot start service appveyor: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./appveyor-server": stat ./appveyor-server: no such file or directory: unknown

ERROR: for appveyor Cannot start service appveyor: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./appveyor-server": stat ./appveyor-server: no such file or directory: unknown
ERROR: Encountered errors while bringing up the project.

This is my Dockerfile:

FROM ubuntu:focal
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

RUN apt update
RUN apt install libcap2-bin ssh -y

RUN apt install wget -y

#RUN wget https://www.appveyor.com/downloads/appveyor/appveyor-server.deb -O appveyor-server.deb
Run wget https://appveyordownloads.blob.core.windows.net/appveyor/7.0.3269/appveyor-host-agent_7.0.3269_amd64.deb -O appveyor-server.deb

RUN dpkg -i appveyor-server.deb
WORKDIR /opt/appveyor/server
EXPOSE 80 443
VOLUME [ "/etc/opt/appveyor/server" ]
VOLUME [ "/var/opt/appveyor/server" ]
ENTRYPOINT [ "./appveyor-server" ]
FeodorFitsner commented 1 year ago

What OS are you running host agent on?

jidanfan commented 1 year ago

This is how I use Appveyor: My OS is Ubuntu:20.04 ,and install docker. I build a Image which install appveyor so I can use Appveyor in docker, and I map "/var/run/docker.sock" into the container so I can use docker could_type to build my dotnet project. The image I use to build project is from "appveyor/build-image:minimal-ubuntu-20.04". I test this way is perfect in appveyor:7.0.3212 (docker:20.10)

FeodorFitsner commented 1 year ago

It could be an issue with container, not AppVeyor Host Agent running container. Host Agent is just using docker run --rm with a bunch of parameters. You can see a full command in journalctl -u appveyor-host-agent log. Try running that command from a command line. Try running your container from command line as well.

jidanfan commented 1 year ago

I think it was AppVeyor Server issue. These are AppVeyor-Server's logs when start a job

appveyor_1  |       Create build 'bin' directory: /tmp/av-build-1
appveyor_1  | appveyor-server Information: 0 : BuildService.RunWorkerJob: Run Job 1hnlkfwls3o0valf
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - start: account_jobs_1
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - lock acquired: account_jobs_1
appveyor_1  | appveyor-server Information: 0 : Memory queueing service - sending message to 'build-manager' queue (Operation=CancelTimeoutBuildJob, AccountId=1, JobId=1hnlkfwls3o0valf, Message=Build execution time has reached the maximum allowed time for your plan (60 minutes).), ttl=, scheduled=03/10/2023 04:15:23
appveyor_1  | appveyor-server Information: 0 : JobService.StartJob: jobId=1hnlkfwls3o0valf
appveyor_1  | appveyor-server Information: 0 : JobService.SetJobAsRunning: jobId=1hnlkfwls3o0valf
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - end: account_jobs_1
appveyor_1  | appveyor-server Information: 0 : BuildCloudConfigurationService.JobStarted: workerId=2b0d9e585df34f86a7fe170789906cb7, jobId=1hnlkfwls3o0valf
appveyor_1  | appveyor-server Information: 0 : LocalDockerBuildCloudService.WorkerJobStarted [2]: workerId=2b0d9e585df34f86a7fe170789906cb7, jobId=1hnlkfwls3o0valf
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - start: cloud_mutex_2
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - lock acquired: cloud_mutex_2
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - end: cloud_mutex_2
appveyor_1  | appveyor-server Information: 0 : docker version --format "{{.Client.Version}} {{.Client.Os}} {{.Client.Experimental}} {{.Server.Version}} {{.Server.Os}} {{.Server.Experimental}}"
appveyor_1  | appveyor-server Information: 0 : BuildService.CompleteWorkerJob: jobId=1hnlkfwls3o0valf, status=failed
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - start: account_jobs_1
appveyor_1  | appveyor-server Information: 0 : RunWithDistributedLockAsync - lock acquired: account_jobs_1
appveyor_1  | appveyor-server Information: 0 : Memory queueing service - sending message to 'build-manager' queue (Operation=DecommissionCloudWorker, JobId=1hnlkfwls3o0valf, BuildCloudId=2, WorkerId=2b0d9e585df34f86a7fe170789906cb7), ttl=, scheduled=
appveyor_1  | appveyor-server Information: 0 : Received Build Manager queue message (Operation=DecommissionCloudWorker, JobId=1hnlkfwls3o0valf, BuildCloudId=2, WorkerId=2b0d9e585df34f86a7fe170789906cb7), messageId=d20cfb99-826a-4bea-823c-37382131e04d, sequenceNumber=2
appveyor_1  | appveyor-server Information: 0 : JobService.SetJobAsFinished: jobId=1hnlkfwls3o0valf
appveyor_1  | appveyor-server Information: 0 : BuildService.DecommissionCloudWorker: jobId=1hnlkfwls3o0valf, workerId=2b0d9e585df34f86a7fe170789906cb7, buildCloudId=2
appveyor_1  | appveyor-server Information: 0 : Token '2b0d9e585df34f86a7fe170789906cb7' cancelled on 83fe36cda79e
appveyor_1  | appveyor-server Information: 0 : Token '2b0d9e585df34f86a7fe170789906cb7' successfully cancelled on 83fe36cda79e
appveyor_1  | appveyor-server Information: 0 : LocalDockerBuildCloudService.DecommissionCloudWorker: workerId=2b0d9e585df34f86a7fe170789906cb7, jobId=1hnlkfwls3o0valf, buildCloudId=2
appveyor_1  | appveyor-server Information: 0 : Finished processing Build Manager queue message (Operation=DecommissionCloudWorker, JobId=1hnlkfwls3o0valf, BuildCloudId=2, WorkerId=2b0d9e585df34f86a7fe170789906cb7) in 25 ms

I see it do log a command

appveyor_1  | appveyor-server Information: 0 : docker version --format "{{.Client.Version}} {{.Client.Os}} {{.Client.Experimental}} {{.Server.Version}} {{.Server.Os}} {{.Server.Experimental}}"

This comamnd not work in docker:23.0.

FeodorFitsner commented 1 year ago

Then you need an updated AppVeyor Server: https://appveyordownloads.blob.core.windows.net/appveyor/7.0.3269/appveyor-server_7.0.3269_amd64.deb

jidanfan commented 1 year ago

This build can running up but still can't start a Docker job ,the Console show:

Starting Docker job...
Index was outside the bounds of the array.

And I see the Docker Command has update

appveyor_1  | appveyor-server Information: 0 : docker version --format "{{.Client.Version}} {{.Client.Os}} {{.Server.Version}} {{.Server.Os}}"
FeodorFitsner commented 1 year ago

Is there more detailed error in a journal log?

jidanfan commented 1 year ago

No,journal logs nothing... Is it possible that the docker version command number of parameters change from 5 to 4 cause?

FeodorFitsner commented 1 year ago

Does it work with an out-of-the-box container?

jidanfan commented 1 year ago

yes, it work in container.

warwick-davis commented 1 year ago

also running into this problem on windows. docker 24

shana commented 10 months ago

@FeodorFitsner I had the same (original OP) issue, installed the new version linked above, and now I get a different error:

Starting Docker job...
Index was outside the bounds of the array.
shana commented 9 months ago

@FeodorFitsner The fix to parse the Docker version is broken, in Appveyor.BuildWorkers.Docker.DockerWorker. GetDockerVersion it's trying to access invalid array indexes, that's why this is crashing. It would be super great to get new builds that work, so I don't have to manually patch the IL to get this to work ❤️

mikehutter commented 6 months ago

I'm attempting to evaluate AppVeyor BYOC and I have this issue with as well.

Docker Engine: 24.0.7 Docker Desktop: 4.26.1

Starting Docker job...
template: version:1:44: executing "version" at <.Client.Experimental>: can't evaluate field Experimental in type system.clientVersion