1
1

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 5 years have passed since last update.

Bash on Ubuntu on Windows に cfコマンドをインストールしたが、cf pushでerror 500が返ってくる

Last updated at Posted at 2016-08-17

概要

タイトルの通りとなりますが、IBM Bluemixに対してcf pushを実行したがデプロイに失敗します。
原因は分かりませんが、IBM Bluemix 側のような気がします、cfの問題?IBM Bluemixとの相性?

対象ユーザ

Windows10 Bash にcfコマンドをインストールし、Bashを起動して、
IBM Bluemix に「hubot」(デフォルトのまま)をcfコマンドでpushしようと考えている人

前提

  • OS:Windows10 Anniversary Update
  • PaSS:IBM Bluemix
  • CF:Linux版(※Windows版はうまくいきます)

Bashを起動したら、rootユーザに切り替えられない

最初に躓いたのですが、Windows10 Anniversary Update にしたときに、専用ユーザを作成し、Bashを起動すると、そのユーザになります。ディレクトリ構成が殆どrootオーナなので、何かとインストールするためには rootユーザになる必要があります。rootパスワードの設定をしていないことから切り替えできません。

1.PNG

そうこう悩んで探しているうちに、Windows 10で始めるBash を参考に、Bash起動時のデフォルトユーザを選択できるみたいです。

2.PNG

Bashを起動して、cfコマンドにインストール

cfコマンドのインストールは本当に簡単です。

CFコマンドのインストール手順

# /sbinにcfコマンドをインストール
cd /sbin

# cfコマンドを取得
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar -zx

# cfコマンドを権限付与
chmod 755 ./cf

問題内容

さて本題の悩んでいるところです。
cf login | logout や、cf start | restart | stop などは利用できますが、
cf push だけ失敗してしまうのです。

# cf push でアプリのdeploy
cf push hubotdev -m 256m --no-start
標準出力の内容
REQUEST: [2016-08-17T07:00:47+09:00]
POST /UAALoginServerWAR/oauth/token HTTP/1.1
Host: login.ng.bluemix.net
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Connection: close
Content-Type: application/x-www-form-urlencoded
User-Agent: go-cli 6.21.1+6fd3c9f / linux

grant_type=refresh_token&refresh_token=※省略

RESPONSE: [2016-08-17T07:00:50+09:00]
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store, max-age=0, must-revalidate,no-store
Content-Type: application/json;charset=UTF-8
Date: Tue, 16 Aug 2016 22:00:47 GMT
Expires: 0
Pragma: no-cache,no-cache
Server: Apache-Coyote/1.1
X-Backside-Transport: OK OK,OK OK
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Global-Transaction-Id: 2648764701
X-Powered-By: Servlet/3.1
X-Xss-Protection: 1; mode=block

---- ※省略

OK

Uploading hubotdev...

REQUEST: [2016-08-17T07:00:59+09:00]
PUT /v2/resource_match HTTP/1.1
Host: api.ng.bluemix.net
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Connection: close
Content-Type: application/json
User-Agent: go-cli 6.21.1+6fd3c9f / linux

[{"sha1":"fa419742b5 ※省略

RESPONSE: [2016-08-17T07:03:04+09:00]
HTTP/1.1 500 Internal Server Error
Connection: close
Content-Type: text/xml; charset="utf-8"
X-Backside-Transport: FAIL FAIL

500 Error: Network error
FAILED
Error processing app files: Error uploading application.
Server error, status code: 500, error code: 0, message: 

HTTP 500 のエラーです。

これがWindows版のcfだと正常に終了します。
せっかくだからということでBashを使ってみようと思ったら、
問題(壁)にあたってしまった内容となります。

1
1
1

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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?