0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Bitnami版Redashで502 Proxy Errorが発生したら

Last updated at Posted at 2022-02-14

環境

  • GCP(Compute Engine)
  • 「Re:dash packaged by Bitnami」を使用してRedashのインスタンスを運用中
  • Redash 8.0.0

事象

とあるクエリの結果をExcelダウンロードしようとすると、「502 Proxy Error」が発生した。
行数は15万行で、条件を絞って取得行数を減らした場合はダウンロードできる。

結論

Apache(Webサーバ)にきたものをGunicorn(アプリケーションサーバ)に流して処理する構成になっていたため、ApacheとGunicornのTimeoutを伸ばすことでダウンロードできるようになった。

対応手順

Gunicornは設定ファイルを見つけられなかったため、起動スクリプトにタイムアウト設定を仕込みました。
もっと良いやり方があればコメントで教えていただけると助かります。

Gunicorn

スクリプトの先頭にあるGunicorn起動用のコマンドに引数でタイムアウトを設定します。

/opt/bitnami/apps/redash/scripts/ctl_redash_gunicorn.sh(編集前)
GUNICORN_START="/opt/bitnami/apps/redash/htdocs/bin/run gunicorn -b 127.0.0.1:5000 --pid /opt/bitnami/apps/redash/logs/redash_gunicorn.pid --log-file /opt/bitnami/apps/redash/logs/redash_gunicorn.log --name redash -w 4 --max-requests 1000 redash.wsgi:app"

/opt/bitnami/apps/redash/scripts/ctl_redash_gunicorn.sh(編集後)
GUNICORN_START="/opt/bitnami/apps/redash/htdocs/bin/run gunicorn -b 127.0.0.1:5000 -t 300 --pid /opt/bitnami/apps/redash/logs/redash_gunicorn.pid --log-file /opt/bitnami/apps/redash/logs/redash_gunicorn.log --name redash -w 4 --max-requests 1000 redash.wsgi:app"

Apache

既存の設定にはなかったので、適当なところにTimeoutを置きます。

/opt/bitnami/apache2/conf/httpd.conf(編集後)
# Timeout
Timeout 300

VMを再起動して完了です。

おまけ

Apacheのログは/opt/bitnami/apache2/logs/error_log
Gunicornのログは/opt/bitnami/apps/redash/logs/redash_gunicorn.log
で確認できます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?