Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: 500 Internal Server Error occures when basic-auth configuration is set #200

Closed
ghost opened this issue Nov 12, 2017 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented Nov 12, 2017

大変便利に使用させていただいております。

CentOS6にローカルインストールしています。
ベーシック認証を設定しております。
設定してすぐには認証できていたのですが、いつからかは不明ですが、正しい認証情報を入れるとInternal Server Errorになってしまいます。

環境

OS CentOS 6.9
Crowi-plus v2.2.0
mongod v3.4.10
node v6.11.3
openjdk 1.8.0
elasticsearch 5.6.3
Redis 3.2.11
npm 4.6.1
yarn 1.1.0

インストールディレクトリは /opt/github/crowi-plus/ です。

エラーメッセージ

1行目はベーシック認証のユーザ名を置換しています。

TypeError: Cannot use 'in' operator to search for 'lang' in [Basic Authentication Usename]
    at Object.lookup (/opt/github/crowi-plus/lib/util/i18nUserSettingDetector.js:8:24)
    at /opt/github/crowi-plus/node_modules/i18next-express-middleware/lib/LanguageDetector.js:100:56
    at Array.forEach (native)
    at LanguageDetector.detect (/opt/github/crowi-plus/node_modules/i18next-express-middleware/lib/LanguageDetector.js:97:22)
    at /opt/github/crowi-plus/node_modules/i18next-express-middleware/lib/index.js:46:96
    at Layer.handle [as handle_request] (/opt/github/crowi-plus/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:317:13)
    at /opt/github/crowi-plus/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:335:12)
    at next (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:275:10)
    at /opt/github/crowi-plus/lib/util/middlewares.js:42:5
    at Layer.handle [as handle_request] (/opt/github/crowi-plus/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:317:13)
    at /opt/github/crowi-plus/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:335:12)
    at next (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:275:10)
    at /opt/github/crowi-plus/lib/util/middlewares.js:12:5
    at Layer.handle [as handle_request] (/opt/github/crowi-plus/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:317:13)
    at /opt/github/crowi-plus/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:335:12)
    at next (/opt/github/crowi-plus/node_modules/express/lib/router/index.js:275:10)

他に必要な情報があればお知らせください。

@yuki-takei
Copy link
Member

@himenos
ご報告いただいた事象、手元(master ブランチ最新)では再現しないみたいです。
(basic 認証を通過し、ログインも正常にできている状態)

症状はいただいたエラーメッセージの通りかと思いますので、再現手順を書いていただけないでしょうか。
あと、対象ユーザーの言語設定は何になっているか、English の場合はユーザーの新規作成後に変更しているか否かを教えてください。

@yuki-takei
Copy link
Member

再現条件確認できずとして close します。
再現した場合はまたお知らせください。

@0kawana
Copy link

0kawana commented Feb 11, 2018

こちらの問題、Deploy to heroku を使用してherokuのfreeプランにデプロイした場合にも再現できました。
管理画面でBASIC認証を設定後にログアウトすると500 Internal Server Error になります。BASIC認証をオフにすると正常動作するので、再度ログイン後再びBASIC認証を設定すると500は発生しません。wikiアカウントにログイン状態でないことが再現条件かと思われます。
crowiのissue#227 crowi/crowi#227 の関連でしょうか。ご確認お願いいたします。

@yuki-takei
Copy link
Member

@0kawana ご報告ありがとうございます。再現確認してみます。

@yuki-takei yuki-takei reopened this Feb 11, 2018
@yuki-takei yuki-takei changed the title ベーシック認証でInternal Server Errorが出てしまう Bug: 500 Internal Server Error occures when basic-auth configuration is set Feb 17, 2018
@yuki-takei
Copy link
Member

@himenos @0kawana 再現確認できました。
修正を施して master にマージしました。次回リリースをお待ちください。
来週中には出せると思います。

@yuki-takei
Copy link
Member

yuki-takei commented Feb 17, 2018

@0kawana
Copy link

0kawana commented Feb 21, 2018

素早い対応ありがとうございます。
私の方でもherokuで正しい動作が確認できました。
ありがとうございました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants