Skip to content

Instantly share code, notes, and snippets.

@ynotna87
Created December 10, 2021 07:38
Show Gist options
  • Save ynotna87/96fc2d37aed51ead2f6a915c8cf7f5cb to your computer and use it in GitHub Desktop.
Save ynotna87/96fc2d37aed51ead2f6a915c8cf7f5cb to your computer and use it in GitHub Desktop.
sentry-install-log
+++ basename ./install.sh
++ [[ install.sh = \i\n\s\t\a\l\l\.\s\h ]]
+++ dirname ./install.sh
++ cd ./install/
++ [[ -f ../.env.custom ]]
+++ realpath ../.env
++ _ENV=/root/self-hosted/.env
+++ mktemp
++ t=/tmp/tmp.fpeVQz26q9
++ export -p
++ set -a
++ . /root/self-hosted/.env
+++ COMPOSE_PROJECT_NAME=sentry-self-hosted
+++ SENTRY_EVENT_RETENTION_DAYS=90
+++ SENTRY_BIND=9000
+++ SENTRY_IMAGE=getsentry/sentry:nightly
+++ SNUBA_IMAGE=getsentry/snuba:nightly
+++ RELAY_IMAGE=getsentry/relay:nightly
+++ SYMBOLICATOR_IMAGE=getsentry/symbolicator:nightly
+++ WAL2JSON_VERSION=latest
++ set +a
++ . /tmp/tmp.fpeVQz26q9
+++ declare -x DEBUG=1
+++ declare -x FTP_PROXY=http://10.0.0.178:8080/
+++ declare -x HISTCONTROL=ignoredups
+++ declare -x HISTSIZE=1000
+++ declare -x HOME=/root
+++ declare -x HOSTNAME=sf-sentry-prod.novalocal
+++ declare -x HTTPS_PROXY=http://10.0.0.178:8080/
+++ declare -x HTTP_PROXY=http://10.0.0.178:8080/
+++ declare -x LANG=en_US.UTF-8
+++ declare -x 'LESSOPEN=||/usr/bin/lesspipe.sh %s'
+++ declare -x LOGNAME=root
+++ declare -x 'LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:'
+++ declare -x MAIL=/var/spool/mail/root
+++ declare -x NO_PROXY=127.0.0.1,localhost
+++ declare -x OLDPWD=/root/self-hosted
+++ declare -x PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
+++ declare -x PWD=/root/self-hosted/install
+++ declare -x SHELL=/bin/bash
+++ declare -x SHLVL=2
+++ declare -x TERM=xterm-256color
+++ declare -x USER=root
+++ declare -x XDG_SESSION_ID=2
+++ declare -x ftp_proxy=http://10.0.0.178:8080/
+++ declare -x http_proxy=http://10.0.0.178:8080/
+++ declare -x https_proxy=http://10.0.0.178:8080/
+++ declare -x no_proxy=127.0.0.1,localhost
++ rm /tmp/tmp.fpeVQz26q9
++ unset t
++ '[' '' = true ']'
++ _group='▶ '
++ _endgroup=
+++ docker compose version
+++ echo docker-compose
++ dc_base=docker-compose
++ dc='docker-compose --ansi never --env-file /root/self-hosted/.env'
++ dcr='docker-compose --ansi never --env-file /root/self-hosted/.env run --rm'
++ SENTRY_CONFIG_PY=../sentry/sentry.conf.py
++ SENTRY_CONFIG_YML=../sentry/config.yml
++ STOP_TIMEOUT=60
+ source parse-cli.sh
++ echo '▶ Parsing command line ...'
▶ Parsing command line ...
++ SKIP_USER_PROMPT=
++ MINIMIZE_DOWNTIME=
++ SKIP_COMMIT_CHECK=
++ (( 1 ))
++ case "$1" in
++ SKIP_USER_PROMPT=1
++ shift
++ (( 0 ))
++ echo ''
+ source check-latest-commit.sh
++ echo '▶ Checking for latest commit ... '
▶ Checking for latest commit ...
++ [[ -d ../.git ]]
++ [[ 0 != 1 ]]
+++ git branch
+++ sed -n '/\* /s///p'
++ [[ master == \m\a\s\t\e\r ]]
+++ git rev-parse HEAD
+++ cut -f1
++++ git rev-parse --abbrev-ref '@{u}'
++++ sed 's/\// /g'
+++ git ls-remote origin master
++ [[ 596be66a0d9e0aa5138fe25c80e39a22cbf6ff23 != 596be66a0d9e0aa5138fe25c80e39a22cbf6ff23 ]]
++ echo ''
+ source error-handling.sh
++ echo '▶ Setting up error handling ...'
▶ Setting up error handling ...
++ DID_CLEAN_UP=0
++ trap_with_arg cleanup ERR INT TERM EXIT
++ func=cleanup
++ shift
++ for sig in '"$@"'
++ trap 'cleanup ERR $LINENO' ERR
++ for sig in '"$@"'
++ trap 'cleanup INT $LINENO' INT
++ for sig in '"$@"'
++ trap 'cleanup TERM $LINENO' TERM
++ for sig in '"$@"'
++ trap 'cleanup EXIT $LINENO' EXIT
++ echo ''
+ source check-minimum-requirements.sh
++ echo '▶ Checking minimum requirements ...'
▶ Checking minimum requirements ...
+++ dirname ./install.sh
++ source ./_min-requirements.sh
+++ MIN_DOCKER_VERSION=19.03.6
+++ MIN_COMPOSE_VERSION=1.28.0
+++ MIN_RAM_HARD=3800
+++ MIN_RAM_SOFT=7800
+++ MIN_CPU_HARD=2
+++ MIN_CPU_SOFT=4
+++ docker version --format '{{.Server.Version}}'
++ DOCKER_VERSION=20.10.11
+++ ver 20.10.11
+++ echo 20.10.11
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
+++ ver 19.03.6
+++ echo 19.03.6
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
++ [[ 20010011 -lt 19003006 ]]
++ docker compose version
+++ docker-compose version
+++ head -n1
+++ sed -E 's/^.* version:? v?([0-9.]+),?.*$/\1/'
++ COMPOSE_VERSION=1.29.2
+++ ver 1.29.2
+++ echo 1.29.2
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
+++ ver 1.28.0
+++ echo 1.28.0
+++ awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'
++ [[ 1029002 -lt 1028000 ]]
+++ docker run --rm busybox nproc --all
++ CPU_AVAILABLE_IN_DOCKER=8
++ [[ 8 -lt 2 ]]
++ [[ 8 -lt 4 ]]
+++ docker run --rm busybox free -m
+++ awk '/Mem/ {print $2}'
++ RAM_AVAILABLE_IN_DOCKER=15884
++ [[ 15884 -lt 3800 ]]
++ [[ 15884 -lt 7800 ]]
+++ docker run --rm busybox grep -c 'Common KVM processor' /proc/cpuinfo
+++ :
++ IS_KVM=0
++ [[ 0 -eq 0 ]]
+++ docker run --rm busybox grep -c sse4_2 /proc/cpuinfo
++ SUPPORTS_SSE42=8
++ [[ 8 -eq 0 ]]
++ echo ''
+ source create-docker-volumes.sh
++ echo '▶ Creating volumes for persistent storage ...'
▶ Creating volumes for persistent storage ...
+++ docker volume create --name=sentry-clickhouse
++ echo 'Created sentry-clickhouse.'
Created sentry-clickhouse.
+++ docker volume create --name=sentry-data
++ echo 'Created sentry-data.'
Created sentry-data.
+++ docker volume create --name=sentry-kafka
++ echo 'Created sentry-kafka.'
Created sentry-kafka.
+++ docker volume create --name=sentry-postgres
++ echo 'Created sentry-postgres.'
Created sentry-postgres.
+++ docker volume create --name=sentry-redis
++ echo 'Created sentry-redis.'
Created sentry-redis.
+++ docker volume create --name=sentry-symbolicator
++ echo 'Created sentry-symbolicator.'
Created sentry-symbolicator.
+++ docker volume create --name=sentry-zookeeper
++ echo 'Created sentry-zookeeper.'
Created sentry-zookeeper.
++ echo ''
+ source ensure-files-from-examples.sh
++ echo '▶ Ensuring files from examples ...'
▶ Ensuring files from examples ...
++ ensure_file_from_example ../sentry/sentry.conf.py
++ [[ -f ../sentry/sentry.conf.py ]]
++ echo '../sentry/sentry.conf.py already exists, skipped creation.'
../sentry/sentry.conf.py already exists, skipped creation.
++ ensure_file_from_example ../sentry/config.yml
++ [[ -f ../sentry/config.yml ]]
++ echo '../sentry/config.yml already exists, skipped creation.'
../sentry/config.yml already exists, skipped creation.
++ ensure_file_from_example ../symbolicator/config.yml
++ [[ -f ../symbolicator/config.yml ]]
++ echo '../symbolicator/config.yml already exists, skipped creation.'
../symbolicator/config.yml already exists, skipped creation.
++ ensure_file_from_example ../sentry/requirements.txt
++ [[ -f ../sentry/requirements.txt ]]
++ echo '../sentry/requirements.txt already exists, skipped creation.'
../sentry/requirements.txt already exists, skipped creation.
++ echo ''
+ source generate-secret-key.sh
++ echo '▶ Generating secret key ...'
▶ Generating secret key ...
++ grep -xq 'system.secret-key: '\''!!changeme!!'\''' ../sentry/config.yml
++ echo ''
+ source replace-tsdb.sh
++ echo '▶ Replacing TSDB ...'
▶ Replacing TSDB ...
++ replace_tsdb
++ [[ -f ../sentry/sentry.conf.py ]]
++ grep -xq 'SENTRY_TSDB = "sentry.tsdb.redissnuba.RedisSnubaTSDB"' ../sentry/sentry.conf.py
++ echo ''
+ source update-docker-images.sh
++ echo '▶ Fetching and updating Docker images ...'
▶ Fetching and updating Docker images ...
++ docker-compose --ansi never --env-file /root/self-hosted/.env pull -q --ignore-pull-failures
++ grep -v -- -self-hosted-local
Some service image(s) must be built from source by running:
docker-compose build snuba-cleanup symbolicator-cleanup snuba-transactions-cleanup sentry-cleanup
++ docker pull getsentry/sentry:nightly
nightly: Pulling from getsentry/sentry
Digest: sha256:de4674766db8eae026d9eb63f5e8ccab9f4b6c2e23eccda8947e4ffa7c3d0a2f
Status: Image is up to date for getsentry/sentry:nightly
docker.io/getsentry/sentry:nightly
++ echo ''
+ source build-docker-images.sh
++ echo '▶ Building and tagging Docker images ...'
▶ Building and tagging Docker images ...
++ echo ''
++ docker-compose --ansi never --env-file /root/self-hosted/.env build --force-rm
smtp uses an image, skipping
memcached uses an image, skipping
redis uses an image, skipping
postgres uses an image, skipping
zookeeper uses an image, skipping
kafka uses an image, skipping
clickhouse uses an image, skipping
geoipupdate uses an image, skipping
snuba-api uses an image, skipping
snuba-consumer uses an image, skipping
snuba-outcomes-consumer uses an image, skipping
snuba-sessions-consumer uses an image, skipping
snuba-transactions-consumer uses an image, skipping
snuba-replacer uses an image, skipping
snuba-subscription-consumer-events uses an image, skipping
snuba-subscription-consumer-transactions uses an image, skipping
symbolicator uses an image, skipping
web uses an image, skipping
cron uses an image, skipping
worker uses an image, skipping
ingest-consumer uses an image, skipping
post-process-forwarder uses an image, skipping
subscription-consumer-events uses an image, skipping
subscription-consumer-transactions uses an image, skipping
relay uses an image, skipping
nginx uses an image, skipping
Building snuba-cleanup
Sending build context to Docker daemon 3.584kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
---> 8d02d510c145
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
---> Using cache
---> ef209c7fec40
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
---> Using cache
---> 46498c568dd7
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> 335f767bf340
Successfully built 335f767bf340
Successfully tagged snuba-cleanup-self-hosted-local:latest
Building snuba-transactions-cleanup
Sending build context to Docker daemon 3.584kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
---> 8d02d510c145
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
---> Using cache
---> ef209c7fec40
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
---> Using cache
---> 46498c568dd7
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> 335f767bf340
Successfully built 335f767bf340
Successfully tagged snuba-cleanup-self-hosted-local:latest
Building symbolicator-cleanup
Sending build context to Docker daemon 3.584kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
---> 0fec701bdb65
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
---> Using cache
---> 70aded5a507f
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
---> Using cache
---> 8d8fb258b48b
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> 0b7dee4d3e0d
Successfully built 0b7dee4d3e0d
Successfully tagged symbolicator-cleanup-self-hosted-local:latest
Building sentry-cleanup
Sending build context to Docker daemon 3.584kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
---> 64c334f42430
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
---> Using cache
---> 5e9bfa9e3fb9
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
---> Using cache
---> c181813dbf5a
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> ac5fa44879e6
Successfully built ac5fa44879e6
Successfully tagged sentry-cleanup-self-hosted-local:latest
++ echo ''
++ echo 'Docker images built.'
Docker images built.
++ echo ''
+ source turn-things-off.sh
++ echo '▶ Turning things off ...'
▶ Turning things off ...
++ [[ -n '' ]]
++ docker-compose --ansi never --env-file /root/self-hosted/.env down -t 60 --rmi local --remove-orphans
Removing sentry-self-hosted_kafka_1 ...
Removing sentry-self-hosted_zookeeper_1 ...
Removing sentry-self-hosted_clickhouse_1 ...
Removing sentry-self-hosted_redis_1 ...
Removing sentry-self-hosted_clickhouse_1 ... done
Removing sentry-self-hosted_zookeeper_1 ... done
Removing sentry-self-hosted_redis_1 ... done
Removing sentry-self-hosted_kafka_1 ... done
Removing network sentry-self-hosted_default
++ echo ''
+ source set-up-zookeeper.sh
++ echo '▶ Setting up Zookeeper ...'
▶ Setting up Zookeeper ...
+++ docker-compose --ansi never --env-file /root/self-hosted/.env run --rm zookeeper bash -c 'ls 2>/dev/null -Ubad1 -- /var/lib/zookeeper/data/version-2 | wc -l | tr -d [:space:]'
Creating network "sentry-self-hosted_default" with the default driver
Creating sentry-self-hosted_zookeeper_run ...
Creating sentry-self-hosted_zookeeper_run ... done
++ ZOOKEEPER_SNAPSHOT_FOLDER_EXISTS=1
++ [[ 1 -eq 1 ]]
+++ docker-compose --ansi never --env-file /root/self-hosted/.env run --rm zookeeper bash -c 'ls 2>/dev/null -Ubad1 -- /var/lib/zookeeper/log/version-2/* | wc -l | tr -d [:space:]'
Creating sentry-self-hosted_zookeeper_run ...
Creating sentry-self-hosted_zookeeper_run ... done
++ ZOOKEEPER_LOG_FILE_COUNT=1
+++ docker-compose --ansi never --env-file /root/self-hosted/.env run --rm zookeeper bash -c 'ls 2>/dev/null -Ubad1 -- /var/lib/zookeeper/data/version-2/* | wc -l | tr -d [:space:]'
Creating sentry-self-hosted_zookeeper_run ...
Creating sentry-self-hosted_zookeeper_run ... done
++ ZOOKEEPER_SNAPSHOT_FILE_COUNT=1
++ cd ..
++ [[ 1 -gt 0 ]]
++ [[ 1 -eq 0 ]]
++ cd install
++ echo ''
+ source install-wal2json.sh
++ echo '▶ Downloading and installing wal2json ...'
▶ Downloading and installing wal2json ...
++ FILE_TO_USE=../postgres/wal2json/wal2json.so
+++ uname -m
++ ARCH=x86_64
++ FILE_NAME=wal2json-Linux-x86_64-glibc.so
++ [[ latest == \l\a\t\e\s\t ]]
+++ docker_curl https://api.github.com/repos/getsentry/wal2json/releases/latest
+++ docker run --rm -e http_proxy -e https_proxy -e HTTPS_PROXY -e no_proxy -e NO_PROXY curlimages/curl:7.77.0 https://api.github.com/repos/getsentry/wal2json/releases/latest
+++ grep '"tag_name":'
+++ sed -E 's/.*"([^"]+)".*/\1/'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 5417 100 5417 0 0 2375 0 0:00:02 0:00:02 --:--:-- 2377
++ VERSION=0.0.2
++ [[ ! -n 0.0.2 ]]
++ mkdir -p ../postgres/wal2json
++ '[' '!' -f ../postgres/wal2json/0.0.2/wal2json-Linux-x86_64-glibc.so ']'
++ cp ../postgres/wal2json/0.0.2/wal2json-Linux-x86_64-glibc.so ../postgres/wal2json/wal2json.so
++ echo ''
+ source bootstrap-snuba.sh
++ echo '▶ Bootstrapping and migrating Snuba ...'
▶ Bootstrapping and migrating Snuba ...
++ docker-compose --ansi never --env-file /root/self-hosted/.env run --rm snuba-api bootstrap --no-migrate --force
Creating sentry-self-hosted_clickhouse_1 ...
Creating sentry-self-hosted_redis_1 ...
Creating sentry-self-hosted_zookeeper_1 ...
Creating sentry-self-hosted_clickhouse_1 ... done
Creating sentry-self-hosted_redis_1 ... done
Creating sentry-self-hosted_zookeeper_1 ... done
Creating sentry-self-hosted_kafka_1 ...
Creating sentry-self-hosted_kafka_1 ... done
ERROR: for snuba-api Container "e975632c5018" is unhealthy.
Encountered errors while bringing up the project.
+++ cleanup ERR 3
+++ [[ 0 -eq 1 ]]
+++ DID_CLEAN_UP=1
+++ [[ ERR != \E\X\I\T ]]
+++ echo 'An error occurred, caught SIGERR on line 3'
An error occurred, caught SIGERR on line 3
+++ [[ -n '' ]]
+++ echo 'Cleaning up...'
Cleaning up...
+++ [[ -z '' ]]
+++ docker-compose --ansi never --env-file /root/self-hosted/.env stop -t 60
+ cleanup EXIT 1
+ [[ 1 -eq 1 ]]
+ return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment