giri
March 4, 2024, 10:15am
1
One Example, which failed
deploy_repositories:
docker:
- image: cimg/node:21.6.1
steps:
- add_ssh_keys:
fingerprints:
- 'dummy'
- checkout
- attach_workspace:
at: "~"
- run:
name: Release
command: |
ssh-add -D && ssh-add ~/.ssh/id_rsa_*
- run:
name: Install Snyk CLI
command: npm install ${snyk_api_import} -g
- run:
name: Run Snyk Import Command
command: SNYK_LOG_PATH=./logs snyk-api-import import --file=./outputs/repos.json
no_output_timeout: 1.5h
- when:
condition:
equal: [ 42, 42 ] # a value that is always true
steps:
- run:
name: Configure User Email
command: git config user.email "dummy"
- run:
name: Configure User Name
command: git config user.name "Github_Bot from Circle CI"
- run:
name: Update git folder
command: git pull origin ${CIRCLE_BRANCH}
- run:
name: Add files to index
command: ls -la && git add -A
- run:
name: Commit New files
command: git commit -m "[skip ci] snyk log files updated via CircleCI"
- run:
name: Push to git
command: git push origin ${CIRCLE_BRANCH}
second example which also did not work:
deploy_repositories:
docker:
- image: cimg/node:21.6.1
steps:
- add_ssh_keys:
fingerprints:
- 'dummy'
- checkout
- attach_workspace:
at: "~"
- run:
name: Release
command: |
ssh-add -D && ssh-add ~/.ssh/id_rsa_*
- run:
name: Install Snyk CLI
command: npm install ${snyk_api_import} -g
- run:
name: Run Snyk Import Command
command: SNYK_LOG_PATH=./logs snyk-api-import import --file=./outputs/repos.json
no_output_timeout: 1.5h
- run:
name: Configure User Email
command: git config user.email "dummy"
when: always
- run:
name: Configure User Name
command: git config user.name "Github_Bot from Circle CI"
when: always
- run:
name: Update git folder
command: git pull origin ${CIRCLE_BRANCH}
when: always
- run:
name: Add files to index
command: ls -la && git add -A
when: always
- run:
name: Commit New files
command: git commit -m "[skip ci] snyk log files updated via CircleCI"
when: always
- run:
name: Push to git
command: git push origin ${CIRCLE_BRANCH}
when: always
Can you repost your config.yml file with the whitespace retained - the </> option in the icon bar of the text input box.
As the config.yml is just yaml the whitespace is key to understanding what is going on when an error occurs.
giri
March 4, 2024, 1:21pm
3
I also tried another example given here
giri
March 4, 2024, 1:32pm
4
Their is no error, the step just times out and then the next step does not run, even with all conditions for it to run. I tried to increase timeout too, but we have a 5h limit in circleci, this step could run for more than 5hrs too. Hence looking for a solution here.
If you have a 5h limit does that mean you are on the ‘Scale’ plan? If so you should contact support directly as it means that you have a SLA in place.
If you have a frequent workflow that hits this limit the recommended options seem to be
switch to a self-hosted runner.
throw a larger instance at the problem.
use parallelism.
Out of these, I would say that taking a look at the self-hosted runner option may be the easiest to do.
giri
March 5, 2024, 9:15am
6
Hello @rit1010 ,
5hr limit is the max CircleCI does, nothing related to us/our plan. I will check the other option you mentioned. Thank you!