cirruslabs / docker-images-flutter

Docker Images for Flutter
MIT License
449 stars 139 forks source link

UnknownHostException with 2.10.3 image #200

Closed sbatezat closed 2 years ago

sbatezat commented 2 years ago

Reproduction:

$ flutter build apk --build-name=$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME:latest
Downloading android-arm-profile/linux-x64 tools...                 836ms
Downloading android-arm-release/linux-x64 tools...                 406ms
Downloading android-arm64-profile/linux-x64 tools...               505ms
Downloading android-arm64-release/linux-x64 tools...               [44](https://***/application/-/jobs/364#L44)5ms
Downloading android-x64-profile/linux-x64 tools...                 [46](https://***/application/-/jobs/364#L46)0ms
Downloading android-x64-release/linux-x64 tools...                 405ms
Running "flutter pub get" in application...                        19.3s
💪 Building with sound null safety 💪
Running Gradle task 'assembleRelease'...                        
Checking the license for package Android SDK Build-Tools 29.0.2 in /opt/android-sdk-linux/licenses
License for package Android SDK Build-Tools 29.0.2 accepted.
Preparing "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)".
"Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" ready.
Installing Android SDK Build-Tools 29.0.2 in /opt/android-sdk-linux/build-tools/29.0.2
"Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" complete.
"Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" finished.
Checking the license for package Android SDK Platform 31 in /opt/android-sdk-linux/licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision: 1)".
"Install Android SDK Platform 31 (revision: 1)" ready.
Installing Android SDK Platform 31 in /opt/android-sdk-linux/platforms/android-31
"Install Android SDK Platform 31 (revision: 1)" complete.
"Install Android SDK Platform 31 (revision: 1)" finished.
Note: /root/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.12/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
java.net.UnknownHostException: runner-twr[62](https://***/application/-/jobs/364#L62)yeq-project-7-concurrent-0: runner-twr62yeq-project-7-concurrent-0: No address associated with hostname
> runner-twr62yeq-project-7-concurrent-0: runner-twr62yeq-project-7-concurrent-0: No address associated with hostname
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org/
BUILD FAILED in 5m 4s
Running Gradle task 'assembleRelease'...                          306.0s
Gradle task assembleRelease failed with exit code 1

Gitlab CI Script :

build:android:
  stage: build
  image: 
  cache:
    key: ${CI_COMMIT_REF_NAME}_pub-cache
    paths:
      - $HOME/.pub-cache
  script:
    -  flutter build apk --build-name=$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME:latest
sbatezat commented 2 years ago

Can anybody help me? Everything I can find is about runner network configuration, but it doesn't seems to be the right path as it's working with older flutter docker images.

fkorotkov commented 2 years ago

runner-twr62

might look like an issue with your CI worker config. Which CI are you using?

sbatezat commented 2 years ago

I'm using my own instance of Gitlab CI. If it's an issue with my runner, why is it working with 2.5.3 image?

fkorotkov commented 2 years ago

I don't believe there were ay changes to the image itself between version 2.5.3 and 2.10.3 beside the different Flutter tags that were cloned. I'm not familiar that much with what happened inside the Flutter SDK between the versions.

I'd suggest to try to reproduce locally on your computer with local Docker daemon so there is a sharable reproducible case we can probably debug together. For now I'm closing the issue since we haven't seen such error before and there is no publicly available project we can reproduce the issue on.