CircleCI version 2.1 - “Cannot find a definition for command named 'restore-cache'”2019 Community Moderator ElectionHow to resolve $TERM not set on gradlew ./assembleRelease on CIrcleCI?Rails Precompiling assets for CIcircleci v2 config - how do we filter by owner in a workflow?CircleCI 2.0 Workflow - Deploy not workingRun a command on CircleCI only once for a branchCircleCI migration: Config fileCircleci runs on merged branchCircleCI API behaving differently from github commit trigger?Errors in CircleCI config.ymlCircleCI error your tests likely make requests to this 'baseUrl' and these tests will fail if you don't boot your server

I can't die. Who am I?

How to get the first element while continue streaming?

How can I highlight parts in a screenshot

Why would the IRS ask for birth certificates or even audit a small tax return?

Difference between 'stomach' and 'uterus'

How can I handle a player who pre-plans arguments about my rulings on RAW?

"seeing as you don't know anyone but me" meaning in this context

Can an earth elemental drown/bury its opponent underground using earth glide?

Why can't we make a perpetual motion machine by using a magnet to pull up a piece of metal, then letting it fall back down?

Is the NES controller port identical to the port on a Wii remote?

Can we carry rice to Japan?

Why did the Cray-1 have 8 parity bits per word?

Would the melodic leap of the opening phrase of Mozart's K545 be considered dissonant?

Rationale to prefer local variables over instance variables?

Is every open circuit a capacitor?

What could be a means to defeat a childrens’ nightmare?

What is the meaning of "notice to quit at once" and "Lotty points”

How to kill a localhost:8080

How do I deal with being envious of my own players?

Meaning of word ягоза

How does signal strength relate to bandwidth?

How to fix my table, centering of columns

Why is it "take a leak?"

How to use math.log10 function on whole pandas dataframe



CircleCI version 2.1 - “Cannot find a definition for command named 'restore-cache'”



2019 Community Moderator ElectionHow to resolve $TERM not set on gradlew ./assembleRelease on CIrcleCI?Rails Precompiling assets for CIcircleci v2 config - how do we filter by owner in a workflow?CircleCI 2.0 Workflow - Deploy not workingRun a command on CircleCI only once for a branchCircleCI migration: Config fileCircleci runs on merged branchCircleCI API behaving differently from github commit trigger?Errors in CircleCI config.ymlCircleCI error your tests likely make requests to this 'baseUrl' and these tests will fail if you don't boot your server










0















I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


But I recieve the following error:



Error: Error calling workflow: 'main'
Error calling job: 'build'
Error calling command: 'build_source'
Cannot find a definition for command named restore-cache


It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



version: 2.1

defaults: &defaults
/**
* Unimportant stuff
*/

aliases:
- &restore-root-cache
keys:
- v1-deps- .Branch - checksum "package.json"
- v1-deps- .Branch
- v1-deps

commands:
build_source:
description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
steps:
- restore-cache: *restore-root-cache
- other-commands...

jobs:
build:
<<: *defaults
steps:
- checkout
- build_source

workflows:
version: 2.1
main:
jobs:
- build:
filters:
branches:
ignore: develop









share|improve this question




























    0















    I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



    circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


    But I recieve the following error:



    Error: Error calling workflow: 'main'
    Error calling job: 'build'
    Error calling command: 'build_source'
    Cannot find a definition for command named restore-cache


    It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



    Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



    version: 2.1

    defaults: &defaults
    /**
    * Unimportant stuff
    */

    aliases:
    - &restore-root-cache
    keys:
    - v1-deps- .Branch - checksum "package.json"
    - v1-deps- .Branch
    - v1-deps

    commands:
    build_source:
    description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
    steps:
    - restore-cache: *restore-root-cache
    - other-commands...

    jobs:
    build:
    <<: *defaults
    steps:
    - checkout
    - build_source

    workflows:
    version: 2.1
    main:
    jobs:
    - build:
    filters:
    branches:
    ignore: develop









    share|improve this question


























      0












      0








      0








      I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



      circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


      But I recieve the following error:



      Error: Error calling workflow: 'main'
      Error calling job: 'build'
      Error calling command: 'build_source'
      Cannot find a definition for command named restore-cache


      It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



      Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



      version: 2.1

      defaults: &defaults
      /**
      * Unimportant stuff
      */

      aliases:
      - &restore-root-cache
      keys:
      - v1-deps- .Branch - checksum "package.json"
      - v1-deps- .Branch
      - v1-deps

      commands:
      build_source:
      description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
      steps:
      - restore-cache: *restore-root-cache
      - other-commands...

      jobs:
      build:
      <<: *defaults
      steps:
      - checkout
      - build_source

      workflows:
      version: 2.1
      main:
      jobs:
      - build:
      filters:
      branches:
      ignore: develop









      share|improve this question
















      I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



      circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


      But I recieve the following error:



      Error: Error calling workflow: 'main'
      Error calling job: 'build'
      Error calling command: 'build_source'
      Cannot find a definition for command named restore-cache


      It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



      Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



      version: 2.1

      defaults: &defaults
      /**
      * Unimportant stuff
      */

      aliases:
      - &restore-root-cache
      keys:
      - v1-deps- .Branch - checksum "package.json"
      - v1-deps- .Branch
      - v1-deps

      commands:
      build_source:
      description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
      steps:
      - restore-cache: *restore-root-cache
      - other-commands...

      jobs:
      build:
      <<: *defaults
      steps:
      - checkout
      - build_source

      workflows:
      version: 2.1
      main:
      jobs:
      - build:
      filters:
      branches:
      ignore: develop






      continuous-integration circleci circleci-2.0 circleci-workflows






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      Anthon

      30.9k1795149




      30.9k1795149










      asked 11 hours ago









      tedigctedigc

      104




      104






















          2 Answers
          2






          active

          oldest

          votes


















          0














          The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



          It should work in commands.






          share|improve this answer






























            0














            restore cache is a special step that needs to be under a job. Not another command.






            share|improve this answer






















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021233%2fcircleci-version-2-1-cannot-find-a-definition-for-command-named-restore-cach%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



              It should work in commands.






              share|improve this answer



























                0














                The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



                It should work in commands.






                share|improve this answer

























                  0












                  0








                  0







                  The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



                  It should work in commands.






                  share|improve this answer













                  The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



                  It should work in commands.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 7 hours ago









                  dnephindnephin

                  11.7k33230




                  11.7k33230























                      0














                      restore cache is a special step that needs to be under a job. Not another command.






                      share|improve this answer



























                        0














                        restore cache is a special step that needs to be under a job. Not another command.






                        share|improve this answer

























                          0












                          0








                          0







                          restore cache is a special step that needs to be under a job. Not another command.






                          share|improve this answer













                          restore cache is a special step that needs to be under a job. Not another command.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 7 hours ago









                          FelicianoTechFelicianoTech

                          2,3091814




                          2,3091814



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021233%2fcircleci-version-2-1-cannot-find-a-definition-for-command-named-restore-cach%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                              Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                              2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived