Resource_class small is not valid

Hi CicleCI team,

we are using the resource_class feature to use only small instances for long-running tasks.
We noticed that the UI shows an error that this class is not valid but the documentation describes this as a valid class. Is there any kind of restrictions for the resource_class: small option?

Yes. You need to contact CircleCI to request using the resource_class feature, even if it’s a downgrade.

I made a feature request to allow this for anyone, but it’s unlikely to be a priority. I suspect that in Docker, there is not a RAM saving from a CircleCI perspective; I believe Docker containers do not reserve the whole of their maximum memory - only Machines (VMs) do that.

(Aside: I couldn’t get the Ideas page to work for me, so it didn’t go into the proper list anyway. Too many conflicts with NoScript and/or Firefox, IIRC).

Not sure I fully understand this. Over 3 years later we are seeing the same message on a paid organisation subscription CircleCI account:

Resource class “small” is not a valid resource class. The default resource class will be used. Learn more

After following the link the documentation doesn’t mention anything about the resource_class feature not being available or requiring further contact or how to do this so it seems there is scope for improvement there. Please could someone advise how we can use the “small” resource class in a paid CircleCI subscription account?

@stec00 could you share a snippet of your config where you are trying to use the small resource class?

The error you’re seeing sometimes comes up when there is a string that is not recognized in the resource_class stanza.

If you don’t want to share the config snippet here, can you open a support ticket and share your config there?

Sure - here is an example fragment from config.yml:

deploy-from-source:
    machine:
      image: ubuntu-2004:current
    resource_class: small
    steps:
      - checkout
      - install_postgres
      - install_aws_cli
      - node_cdk_bootstrap_and_deploy

@stec00 Ah, thanks for sharing. So on our “machine” executors, we don’t have a “small” resource class. We do have a small resource class for our “docker” executor.

1 Like

Thanks @sebastian-lerner, makes sense. The error message could be more helpful though! So would I be right in assuming no resource classes are available for a “machine” executor and it shouldn’t be specified in this case?

1 Like

I should have been more precise, sorry. You can totally use resource classes for our plain “Linux machine” executors. Configuring CircleCI - CircleCI. Medium is just the smallest one. So if you switch “small” to “medium” in your config, you should be good to go.

1 Like

A small or even micro machine would also be useful for anyone who is trying to trigger another workflow from within a circleci.yml script as a machine instance must be defined - the result is an instance that is run for just a few seconds and does nothing except incurring a small credit cost.

I hit the same a similar error Job was rejected because resource class unknown is not a valid resource class when I forgot to specify 2.1 at the top of my config.yml file:

version: 2. ( fail )

Moving to:

version: 2.1 ( ok )

The config version paired with machine runners only being available in medium+ sizes (not small), are probably the two most common reasons these errors will occur.