Comments (18)
experiencing this issue after installing circleci
with snap as by instructions and trying to run the hello world example.
➜ circleci-demo-go git:(master) circleci local execute --job build
Docker image digest: sha256:02289762fd0a295b971e4bc6bdb2ea4326a66748cae89352b5404c4ca286aaf9
Error: failed to start event processor: failed to compute task config: failed to read config file: read /tmp/local_build_config.yml: is a directory
this could be connected with limitations of snap packages to the $HOME
directory, as it is trying to write/read a files save in the root /tmp/
while circleci
can only run in /usr/home/<user-name>
SOLUTION TO FIX THE ISSUE
Remove snap packages (docker and snap)
sudo snap remove circleci docker
I used the command from the quick installation instructions without sudo and saved the bin
file in my /home/<username>/Downloads
folder
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | DESTDIR=/home/fabrizio/Downloads bash
then I moved the binary sudo mv /home/fabrizio/circleci /usr/local/bin
, /usr/local/bin
is in my path so I have access within the $HOME
as normal user.
Installing docker as by askubuntu instructions (options 2), adding myself to the docker group and now the command works without problems
circleci
was failing because snap
installation can not write or read /tmp
It was fun playing with Ubuntu the entire day...
from circleci-cli.
I'm running into the same issue, it doesn't even work for the demo repo.
circleci-demo-go$ circleci local execute --job build
Docker image digest: sha256:2e3d8ff7707b34b815fc6174ae5f6fcd8384f7a166a219bad29ac5ffc139f475
Error: failed to start event processor: failed to compute task config: failed to read config file: read /tmp/local_build_config.yml: is a directory
from circleci-cli.
@fabriziobertoglio1987 I can't run the quick installation command without sudo. When I try to run it I get this error:
$ curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | DESTDIR=/home/zach/Downloads bash
Starting installation.
Installing CircleCI CLI v0.1.15085
Installing to /home/zach/Downloads
An error occured installing the tool.
The contents of the directory /tmp/tmp.1O5TPuzqUN have been left in place to help to debug the issue.
from circleci-cli.
I am facing a similar issue trying to run a generated config yml using circleci local execute
in CircleCI.
In my test, I generate a processed.yml
(running on CircleCI) and then execute:
circleci local execute --config /home/circleci/project/test/tmp.H4nOfY/processed.yml
But I get an error:
Downloading latest CircleCI build agent...
Docker image digest: sha256:...^@^@Error: failed to start event processor: failed to compute task config: failed to read config file: open /home/circleci/project/test/tmp.H4nOfY/processed.yml: no such file or directory
Exited with code 1
Is there a workaround for this?
from circleci-cli.
@anishkny A workaround for running a CircleCI config generated inside of a CircleCI job is to commit that config and push it to Github/Bitbucket to trigger a new build. This is far from ideal, so we are considering ways to execute a new config without a commit and push.
from circleci-cli.
Trying to get CircleCI working locally circleci local execute
.
This works (and is simpler IMO 👍 )
- Run Docker in Docker with
git
tag (so CircleCI CLI can usegit
command within the container)/usr/bin/docker run --rm --privileged --tty --interactive --volume /tmp:/tmp:rw --volume /var/run/docker.sock:/var/run/docker.sock:ro --user root --name circleci docker:git /bin/sh
- Notice flags
--privileged
,volume
fordocker.sock
and arw
mount of local/tmp
. - Running container as
--user=root
- Once inside the container, install
bash
,curl
followed by CircleCI CLI./sbin/apk update
/sbin/apk add bash curl
/usr/bin/curl -fLSs https://circle.ci/cli | /bin/bash
- For a simple hello world example using CircleCI CLI (within the container, of course)
Downloading latest CircleCI build agent...
Docker image digest: sha256:f19e1f3d0aadb3dedfeb147b8e603fbbe7a9afba924b0db0c43f74753002c96b
====>> Spin up environment
Build-agent version ()
System information:
Server Version: 20.10.11
Storage Driver: overlay2
Backing Filesystem: extfs
Cgroup Driver: cgroupfs
Cgroup Version: 1
Kernel Version: 4.19.232-1.ph3-esx
Operating System: VMware Photon OS/Linux
OSType: linux
Architecture: x86_64
Starting container cimg/ruby:3.0-node
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
image is cached as cimg/ruby:3.0-node, but refreshing...
3.0-node: Pulling from cimg/ruby
Digest: sha256:22ef54404f4676b4f329fc7e0537d32b016e2120bdabb47c191f184d5a4aa56f
Status: Image is up to date for cimg/ruby:3.0-node
cimg/ruby:3.0-node:
using image cimg/ruby@sha256:22ef54404f4676b4f329fc7e0537d32b016e2120bdabb47c191f184d5a4aa56f
pull stats: Image was already available so the image was not pulled
time to create container: 437ms
Creating Docker containers in parallel
Time to upload agent and config: 1.112579856s
Time to start containers: 1.090775188s
====>> Preparing environment variables
Using build environment variables:
BASH_ENV=/tmp/.bash_env-localbuild-1648434504
CI=true
CIRCLECI=true
CIRCLE_BRANCH=
CIRCLE_BUILD_NUM=
CIRCLE_JOB=build
CIRCLE_NODE_INDEX=0
CIRCLE_NODE_TOTAL=1
CIRCLE_REPOSITORY_URL=
CIRCLE_SHA1=
CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1648434504
CIRCLE_WORKING_DIRECTORY=~/project
The redacted variables listed above will be masked in run step output.====>> Checkout code
Making checkout directory "/home/circleci/project"
Copying files from "/tmp/_circleci_local_build_repo" to "/home/circleci/project"
====>> echo "Hello World"
#!/bin/bash -eo pipefail
echo "Hello World"
Hello World
Success!
Works for below errors-
circleci Error: failed to start event processor: failed to compute task config: failed to read config file:
(👍 Step 1)cp: cannot stat '/tmp/_circleci_local_build_repo/.git': No such file or directory
(👍 Try step 3 on a hello world project)
from circleci-cli.
For MacOS, this worked: #391 (comment)
Looks like was regression
from circleci-cli.
@zmunro run those steps one by one in your terminal, you will be able to read and troubleshoot the error.
from circleci-cli.
It's confusing because I'm using .circleci/config.yml and not using circle.yml
The error message is a bit misleading, but it is checking for .circleci/config.yml
first and falling back to circle.yml
if it doesn't find it.
Maybe try adding some ls -a
or tree -a
to the commands to check the directory myTestProject
contains the files you expect? This error is coming from the entrypoint so very little is happening before this error. I'm not seeing any way for this to fail unless the file isn't there.
From your config example generate_project
doesn't seem to accept a path, but the other jobs are using a working_directory
, so I'm not sure if the make
target creates that directory or not.
from circleci-cli.
Thanks for the quick reply!
The generated project does contain the files I expect (I've been ssh'ed in there for a while + I just added a ls -a . && ls -a .circleci
and it looks good). Regarding the generate_project
command, I did simplify it to remove unnecessary noise but there was a path argument and this part seems to work fine.
So I don't think it's a generation problem.
I can link to the failing build on CircleCI if that helps.
from circleci-cli.
/home/circleci/project-generator/myTestProject/.circleci/config.yml
is properly generated (I cancat
it)circleci local execute --job myjob --config /home/circleci/project-generator/myTestProject/.circleci/config.yml
still fails with:$ circleci local execute --job backend --config /home/circleci/project-generator/myTestProject/.circleci/config.yml Docker image digest: sha256:0ae15d9b8329446dd5d241b1d654774871caa89c1cc47d513063c23037aae917 Error: failed to start event processor: failed to compute task config: failed to read config file: open /home/circleci/project-generator/myTestProject/.circleci/config.yml: no such file or directory
I can only see two explanations:
- it's a permission error (eg. the CircleCI spaws a child process with a different user that can't read the file)
- or there's an error handling problem somewhere in the cli or one of its dependencies which makes it look like a "no such file or directory" error when it's actually somethign else (I think this happens in build.go but I'm a go noob so not entirely sure...)
from circleci-cli.
Oh, I just reread your post and I realize I missed the obvious. This won't work because local execute
uses bind mount volumes and a docker engine provided by setup_remote_docker
. setup_remote_docker
does not work with bind mount volumes. The engine is running on a VM host which doesn't have access to the container filesystem where the job is running.
from circleci-cli.
Aaaaah, ok so I guess I'll have to find something else then. :(
Just for curiosity's sake, does that explain the error I'm seeing? It sounds like the error happens before the CLI even tries to run a docker command, right?
from circleci-cli.
@n6g7 The error message is misleading; in the current version, it's always shown for various kinds of reasons.
@dnephin I'm also trying to get the build working circumventing the new cli and directly calling the picard cli from a Docker container. However, I'm confused that there is no docker on the image and a Docker config and environment variables don't seem to be respected. Then again, the image seems to need the docker socket. Is this cli closed source?
from circleci-cli.
does that explain the error I'm seeing
Yes it does, the file system that it's looking at does not have that file because it's a bind mount to the VM host that does not have any files at that path.
It sounds like the error happens before the CLI even tries to run a docker command
There are two programs. circleci-cli
runs circleci-agent
in a container. local execute
is implemented in circleci-agent
, so it runs in the container.
Is this cli closed source?
circleci-agent
is closed source at this time.
from circleci-cli.
Closing due to inactivity. Please re-open if this is something you are still working on.
from circleci-cli.
Oh, I just reread your post and I realize I missed the obvious. This won't work because local execute uses bind mount volumes and a docker engine provided by setup_remote_docker. setup_remote_docker does not work with bind mount volumes. The engine is running on a VM host which doesn't have access to the container filesystem where the job is running.
@dnephin thanks for a thorough answer. It makes sense that circleci-agent
runs inside a container. I'm running circleci local execute
inside a docker container with mounted /var/run/docker.sock
into the container from the host. Getting the same error. Is there a way for circleci-agent
to have the file mounted so we can run circleci local execute
inside a container?
from circleci-cli.
@fabriziobertoglio1987 Thanks, I just run the script and its working now.
from circleci-cli.
Related Issues (20)
- Change `.circleci` home directory location with an Environment variable HOT 3
- Allow configuring http client timeout HOT 2
- [Feature Request] Add number of Active tasks in "runner instance list" command
- Wrong version of circleci inside local execution env HOT 2
- CircleCI Orb Init Error Misleading HOT 2
- Unable to start job with private images using `circleci local execute`
- docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /tmp/3966974312_circleci_config.yml. HOT 1
- IN1-GOLANG-GITHUBCOMCLOUDFLARECIRCLPKEKYBERINTERNALCOMMON-6150686 - github.com/cloudflare/circl
- CircleCI CLI policy test command missing timestamp in JUnit output HOT 2
- Set "maintainer" label for Docker image HOT 2
- Json unmarshall error HOT 2
- Error: Unable to validate config HOT 4
- Clarify `orb validate` and `config validate` scope of validation HOT 1
- Infinite install bug HOT 2
- Provide mac arm64 release asset
- unable to execute local job on mac m1 pro HOT 2
- invalid character 'I' looking for beginning of value HOT 13
- ` local execute build` command fails when sidecar is present and using the latest docker version
- circleci config pack command is not working with latest version (v0.1.28363) HOT 2
- Orb validation fails HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circleci-cli.