https://docs.sonarqube.org/latest/setup/upgrading/
https://community.sonarsource.com/t/insufficient-memory-and-cannot-create-worker-gc-thread/88600
https://github.com/GoogleCloudPlatform/pgadapter/issues/405
Ubuntu 16.04 | 起動せず |
Ubuntu 18.04(元16.04) | 起動せず |
Ubuntu 20.04(元16.04) | 起動せず |
Ubuntu 20.04(元16.04) パッケージUpdate | Dockerサービス起動失敗で詰みと思いきや再起動後にトライで成功。OSアップデートで3回再起動 |
Ubuntu 20.04/AmazonLinux 2023では再現せず
sonarqube | [0.086s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached. sonarqube | # sonarqube | # There is insufficient memory for the Java Runtime Environment to continue. sonarqube | # Cannot create worker GC thread. Out of system resources. sonarqube | # An error report file with more information is saved as: sonarqube | # /tmp/hs_err_pid1.log sonarqube exited with code 1
[ec2-user@ip-172-31-2-208 ~]$ uname -a Linux ip-172-31-2-208.ap-northeast-1.compute.internal 5.10.173-154.642.amzn2.x86_64 #1 SMP Wed Mar 15 00:26:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create worker GC thread. Out of system resources.
# Possible reasons:
# The system is out of physical RAM or swap space
# The process is running with CompressedOops enabled, and the Java Heap may be
blocking the growth of the native heap
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# JVM is running with Unscaled Compressed Oops mode in which the Java heap is
# placed in the first 4GB address space. The Java Heap base address is the
# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddres s
# to set the Java Heap base and to place the Java Heap above 4GB virtual add ress.
# This output file may be truncated or incomplete.
#
# Out of Memory Error (workerManager.hpp:87), pid=1, tid=1
#
# JRE version: (17.0.6+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (17.0.6+10, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g 1 gc, linux-amd64)
/opt/java/openjdk/bin/java -XX:CICompilerCount=2 -XX:-UseCompressedOops -Xss136k -Xmx256m -Xms256m -jar lib/sonarqube.jar
圧縮Ops無効 | -XX:-UseCompressedOops | 状況かわらず |
スタックサイズ縮小 | -Xss136k | 状況かわらず |
コードキャッシュ増加 | -XX:ReservedCodeCacheSize=128 | 状況かわらず |
https://stackoverflow.com/questions/25682398/how-to-reduce-the-number-of-threads-used-by-the-jvm
-XX:+UseSerialGC | 起動せず |
-XX:CICompilerCount=2 | 状況かわらず |
-XX:+ReduceSignalUsage | 状況かわらず |
-XX:+DisableAttachMechanism | 状況かわらず |
仕事のやつで遭遇した困った問題。 一覧には出てこない。個別に指定すると出てくる。
indexの作り直しでうまく行くのかは試してないけど試して見る価値あり。
ServerID 243B8A4D-AX0SEMDXHfZSM2p8OkQR
SAML 関連に値を入れる
docker volume create --name sonarqube_sonarqube_data79 docker volume create --name sonarqube_sonarqube_extensions79 docker volume create --name sonarqube_postgres_data79 docker volume create --name sonarqube_postgres79
docker container run --rm -it -v sonarqube_sonarqube_extensions:/from -v sonarqube_sonarqube_extensions79:/to alpine ash -c "cd /from ; cp -av . /to" docker container run --rm -it -v sonarqube_sonarqube_data:/from -v sonarqube_sonarqube_data79:/to alpine ash -c "cd /from ; cp -av . /to" docker container run --rm -it -v sonarqube_postgresql_data:/from -v sonarqube_postgres_data79:/to alpine ash -c "cd /from ; cp -av . /to" docker container run --rm -it -v sonarqube_postgresql:/from -v sonarqube_postgres79:/to alpine ash -c "cd /from ; cp -av . /to"
この時点で付け替えしてみて起動することを確認する
ServerID 243B8A4D-AX0RveuJOTnufm9wIf7w
間違えないように注意!
sonarqube7.9のdockerをrm extentionsのvolumeをrm dataのvolumeをrm
ServerID 243B8A4D-AX0SEMDXHfZSM2p8OkQR
sonarqube_dataが共有だったせいかエラーで起動せず。 docker-compose downしなかったので、DBが戻らず起動せず。
downしてps -aででてこない状態を確認して戻せば切り戻し成功!
docker-compose exec db /bin/bash
pg_dumpall -U sonar > /var/tmp/backup.sql exit
sudo docker cp `sudo docker-compose ps -q db`:/var/tmp/backup.sql ./
SonarQube ID information Server ID: 243B8A4D-AX3X9bKMqyoRPKdD1a_m Version: 7.9.6.41879 Date: 2022-01-06
sudo docker cp backup.sql `sudo docker-compose ps -q db`:/var/tmp/backup.sql
psql -U sonar < /var/tmp/backup.sql exit
SonarQube ID information Server ID: BCE753A0-AX3X9bKMqyoRPKdD1a_m Version: 7.9.6.41879 Date: 2022-01-06
SonarQube ID information Server ID: 243B8A4D-AX3X9bKMqyoRPKdD1a_m Version: 7.9.6.41879 Date: 2022-01-06