Circleci CLI from snap can't find config file

I installed the circleci CLI from snap on Ubuntu 16.04.3 using

sudo snap install docker circleci
sudo snap connect circleci:docker docker

I try to validate a config file…

$ circleci config validate -c .circleci/config.yml

Error: open .circleci/config.yml: no such file or directory

The file sure does exist as I used tab completion…

Much frustration later I download the circleci binary manually per alternate instructions.

curl -o /tmp/circleci https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci

in the very same directory as the failed command above.

$ /tmp/circleci config validate -c .circleci/config.yml

  config file is valid

Hey!

Thanks for your report.

Just letting you know we’ll investigate and update once we’ve found a fix.

Hey, would you be able to provide the output of the following commands?

snap list
snap --version

For the list, if you’re not comfortable listing everything, I’m really interested in the output for circleci, docker, and core.

Thanks

@sigHUPster Re-reading your post, I think I understand what’s happening now. You have the repo in /tmp? The Docker snap can read files from within $HOME. If you have the Git repo anywhere within your local user’s $HOME path, it’ll have no problem reading the config file.

Since there hasn’t been a response, I’m going to assume that was the issue. Snaps cannot read from /tmp, only within $HOME. CircleCI Docs has a pending PR to clarify this: https://github.com/circleci/circleci-docs/pull/2113

Hey, apologies on the slow reply.

Yes, looks like you’re right. Not only does the config have to be in $HOME but the snap command must be initiated from there too.

josh@admin:/some/other/path$ circleci config validate -c ~/.circleci/config.yml

Error: open /home/josh/.circleci/config.yml: no such file or directory
josh@admin:/some/other/path$ cd
josh@admin:~$ circleci config validate -c ~/.circleci/config.yml

  config file is valid