Using the CLI to validate a config that references a private orb

I’m attempting to cut down on copy/pasta through our multiple repos by using private orbs. I’ve built a simple orb to test things out and verify our workflow and I have one sticking point, a .circleci/config.yml will not validate using circleci config validate when a private orb is referenced. I’ve committed the config.yml and it runs perfectly fine in CircleCI.

When I run the validate, I receive the following error:

➜  test git:(orbify) ✗ circleci config validate
Error: Cannot find xxx/orbtest@0.0.1 in the orb registry. Check that the namespace, orb name and version are correct.
Cannot find xxx/orbtest@0.0.1 in the orb registry. Check that the namespace, orb name and version are correct.
➜  test git:(orbify) ✗ circleci orb list xxx --private
Orbs found: 1. Showing only private orbs.

xxx/orbtest (0.0.1)
➜  test git:(orbify) ✗ circleci version  
0.1.15973+ce8624c (homebrew)

As you can see, the orb is available (sorry for the masked namespace and name). Are there plans to add this functionality into the CLI anytime soon? Having to do a commit and check the CircleCI project is a bit cumbersome and wastes a fair amount of time.

1 Like

Hi @mwhitney-rbi, and welcome to the CircleCI Discuss community!

This is indeed a limitation when using private orbs. In this case, you can validate your configuration with:

config validate --org-slug <your-org-slug> <path/to/config.yml> 

 
Let me know if this helps.

1 Like

@yannCI thanks! I knew I was missing something from the documentation. However, even using the org slug, I’m not able to validate and get a permission denied even though I can list the orbs fine.

➜  test git:(orbify) ✗ circleci orb list xxx --private                             
Orbs found: 1. Showing only private orbs.

xxx/orbtest (0.0.1)

➜  test git:(orbify) ✗ circleci config validate --org-slug xxx .circleci/config.yml
Error: Unable to validate config: Permission denied

same problem, private orb just throws “Error: Unable to validate config: Permission denied”

1 Like

@yannCI same for us. Trying to solve an issue where the web portal shows no workflows, and the local validate complains about our private orbs.

Is issue this still unresolved?

I was able to get this to work by specifying the --org-slug as github/org

I had seen the notes about it not working at all, so this is a big improvement (being able to specify --org-slug)!. For me, this works great, and I’m now able to validate configs with private orbs.

That said, wonder if there’s any plan to add any further improvements, like letting you set an organization to search for private orgs by default?

for publishing, I see this config in cli.yml:

orb_publishing:
    default_namespace: ""
    default_vcs_provider: ""
    default_owner: ""

I tested, and populating these values (or setting org_slug there) did not seem to work, but it would be nice if the CLI config could either infer the slug from those fields in orb_publishing, or have a parallel field for validation.