pipeline stalling at apt-get for openjdk 11 and never finishing
Asked by bill comer:

We have a pipeline that has not changed in months, worked 100% fine \& today suddenly it is getting stuck.

Any ideas please. Does BitBucket have an issue or should we update or change our image

we have:

```
image: atlassian/default-image:3
```

```
script:
  - apt-get update && apt-get install -y mysql-client openjdk-11-jdk maven
```

```

The log file get's stuck at the apt-get line. here is the log file
```

Get:67 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 mysql-client-core-8.0 amd64 8.0.27-0ubuntu0.20.04.1 [4423 kB]  
Get:68 <http://archive.ubuntu.com/ubuntu> focal/main amd64 mysql-common all 5.8+1.0.5ubuntu2 [7496 B]  
Get:69 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 mysql-client-8.0 amd64 8.0.27-0ubuntu0.20.04.1 [22.0 kB]  
Get:70 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 mysql-client all 8.0.27-0ubuntu0.20.04.1 [9424 B]  
Get:71 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 openjdk-11-jre amd64 11.0.13+8-0ubuntu1~20.04 [175 kB]  
Get:72 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 openjdk-11-jdk-headless amd64 11.0.13+8-0ubuntu1~20.04 [223 MB]  
`This step normally tales about ~40 seconds. Now it never completes.`  
The full pipeline file is here:  

```
#  Template maven-build

#  This template allows you to test and build your Java project with Maven.
#  The workflow allows running tests, code checkstyle and security scans on the default branch.

# Prerequisites: pom.xml and appropriate project structure should exist in the repository.

image: atlassian/default-image:3

definitions:
  services:
      mysql:
        image: mysql:5.7
        variables:
          MYSQL_DATABASE: 'portal2_test'
          MYSQL_USER: 'ptportalapp'
          MYSQL_PASSWORD: 'let_me_in'
          MYSQL_ROOT_PASSWORD: 'let_me_in'

  steps:
    - step: &GenericBuildAndTest
        name: Build and Test
        image: atlassian/default-image:3
        caches:
          - maven
        script:
          - apt-get update && apt-get install -y mysql-client openjdk-11-jdk maven
          - mysql --user=root --password=let_me_in --host=127.0.0.1 portal2_test < src/test/resources/test_schema-bitbucket.sql
          - mvn package -Dspring.profiles.active=local-bitbucket -Dnet.sf.ehcache.disabled=true
        artifacts:
          - target/pt-portal-*jar
        services:
          - mysql

    - step: &GenericUploadToS3
            name: Upload to s3
            script:
              - source set_env.sh
              - echo Will Upload to environment:$S3_TARGET_LOCATION
              - mkdir -p artifacts
              - mv target/pt-portal-*jar artifacts
              - pipe: atlassian/aws-s3-deploy:0.3.8
                variables:
                  AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
                  AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
                  AWS_DEFAULT_REGION: 'us-west-1'
                  S3_BUCKET: $S3_TARGET_LOCATION
                  LOCAL_PATH: artifacts
              - echo Upload complete for branch $BITBUCKET_BRANCH
            artifacts:
              - artifacts/**

    - step: &GenericGetDockerVersion
      name: Get Docker Version
      script:
        - docker version
      services:
        - docker

    - step: &GenericBuildAndTestWithRestictedListOfTests
        name: Build and no Test
        image: atlassian/default-image:3
        caches:
          - maven
        script:
          - apt-get update && apt-get install -y mysql-client openjdk-11-jdk maven
          - mysql --user=root --password=let_me_in --host=127.0.0.1 portal2_test < src/test/resources/test_schema-bitbucket.sql
          - mvn package -Dspring.profiles.active=local-bitbucket -Dtest=$RESTRICTED_LIST_OF_TESTS -Dnet.sf.ehcache.disabled=true
        artifacts:
          - target/pt-portal-*jar
        services:
          - mysql

    - step: &GenericGetDockerVersion
      name: Get Docker Version
      script:
        - docker version
      services:
        - docker

    - step: &GenericSecurityScan
        name: Security Scan
        script:
          # Run a security scan for sensitive data.
          # See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&category=security
          - pipe: atlassian/git-secrets-scan:0.4.3

pipelines:
  default:
    - step:
        name: setup env to upload to branch
        script:
          - S3_TARGET_LOCATION=$S3_BUCKET_LOCATION/$BITBUCKET_BRANCH
          - echo "export S3_TARGET_LOCATION=$S3_TARGET_LOCATION" > set_env.sh
        artifacts:
          - set_env.sh
    - step: *GenericBuildAndTest
    - step: *GenericSecurityScan
    - step: *GenericUploadToS3

  branches:
    master:
      - step: *GenericBuildAndTest
      - step: *GenericSecurityScan
      - step:
          name: setup env to upload to branch
          script:
            - S3_TARGET_LOCATION=$S3_BUCKET_LOCATION/$BITBUCKET_BRANCH
            - echo "export S3_TARGET_LOCATION=$S3_TARGET_LOCATION" > set_env.sh
          artifacts:
            - set_env.sh
      - step: *GenericUploadToS3
      - step:
          name: setup env to upload to PROD
          script:
            - S3_TARGET_LOCATION=$S3_PROD_BUCKET_LOCATION
            - echo "export S3_TARGET_LOCATION=$S3_TARGET_LOCATION" > set_env.sh
          artifacts:
            - set_env.sh
      - step: *GenericUploadToS3

  custom:
    build_and_run_restricted_list_test:
      - step: *GenericBuildAndTestWithRestictedListOfTests




```


Answers:
author: bill comer
body: well whatever it was it has fixed itself with us doing nothing.

The step I mentioned above finished in 38seconds at the last attempt


Tags: bitbucket-cloud

cloud