CloudfoundryをさくらVPSにインストール > 一部エラー > 解決

さくらVPS 1G CentOS 6.2にCloudfoundryをインストールしようとしてたんだけど、どうやらCentOS 6.2で動かすためのスクリプトがないっぽい。CentOS 5だと下のURLの方法でできそうだったんだけど。

ということで、CentOSからUbuntuに載せ替えることに。幸いgitでしか使ってなかったので。以下のURLを参考にUbuntu 10.04 amd 64に載せ替えました。

それで、このURLにあるようにインストールをしてみたわけだけど、

このコマンドね↓

hironemu$ bash < <(curl -s -k -B https://raw.github.com/cloudfoundry/vcap/master/dev_setup/bin/vcap_dev_setup)

↓こんなエラーがでた。しかも結構ビルドが進んだあとで。

[INFO] 4 warnings 
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/TokenAdminEndpoints.java:[117,8] cannot find symbol
symbol  : method setAdditionalInformation(java.util.Map<java.lang.String,java.lang.Object>)
location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[71,13] cannot find symbol
symbol  : method setAdditionalInformation(java.util.Map<java.lang.String,java.lang.Object>)
location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[81,29] org.springframework.security.oauth2.common.OAuth2AccessToken is abstract; cannot be instantiated
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[82,8] cannot find symbol
symbol  : method setScope(java.util.Set<java.lang.String>)
location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[83,8] cannot find symbol
symbol  : method setExpiration(java.util.Date)
location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[84,8] cannot find symbol
symbol  : method setRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken)
location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[INFO] 6 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CloudFoundry Identity - Parent .................... SUCCESS [52.675s]
[INFO] CloudFoundry Identity Common Jar .................. FAILURE [3:35.447s]
[INFO] User Account and Authentication Service ........... SKIPPED
[INFO] CloudFoundry Identity - Samples ................... SKIPPED
[INFO] Sample resource server for Cloudfoundry Identity Services  SKIPPED
[INFO] Sample user webapp for Cloudfoundry Identity Services  SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:43.862s
[INFO] Finished at: Sun Apr 22 00:06:03 JST 2012
[INFO] Final Memory: 14M/38M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project cloudfoundry-identity-common: Compilation failure: Compilation failure:
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/TokenAdminEndpoints.java:[117,8] cannot find symbol
[ERROR] symbol  : method setAdditionalInformation(java.util.Map<java.lang.String,java.lang.Object>)
[ERROR] location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[71,13] cannot find symbol
[ERROR] symbol  : method setAdditionalInformation(java.util.Map<java.lang.String,java.lang.Object>)
[ERROR] location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[81,29] org.springframework.security.oauth2.common.OAuth2AccessToken is abstract; cannot be instantiated
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[82,8] cannot find symbol
[ERROR] symbol  : method setScope(java.util.Set<java.lang.String>)
[ERROR] location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[83,8] cannot find symbol
[ERROR] symbol  : method setExpiration(java.util.Date)
[ERROR] location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] /home/hironemu/cloudfoundry/vcap/uaa/common/src/main/java/org/cloudfoundry/identity/uaa/oauth/JwtTokenServices.java:[84,8] cannot find symbol
[ERROR] symbol  : method setRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken)
[ERROR] location: interface org.springframework.security.oauth2.common.OAuth2AccessToken
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cloudfoundry-identity-common
STDERR: 
---- End output of "bash"  "/tmp/chef-script20120422-5394-1hl5849-0" ----
Ran "bash"  "/tmp/chef-script20120422-5394-1hl5849-0" returned 1

いろいろい調べてたけどよくわからんから、一旦カレントディレクトリにできたcloudfoundryディレクトリを削除してもっかい実行。

↓これ

hironemu$ bash < <(curl -s -k -B https://raw.github.com/cloudfoundry/vcap/master/dev_setup/bin/vcap_dev_setup)

お風呂に入って戻ってきてみると、なんかエラーなく終わってた。

Deployment Info
***************
* Status: Success
* Config files: /home/hironemu/cloudfoundry/.deployments/devbox/config
* Deployment name: devbox
* Note:
  * If you want to run ruby/vmc please source the profile /home/hironemu/.cloudfoundry_deployment_profile
  * If you want to run cloudfoundry components by hand please source the profile /home/hironemu/.cloudfoundry_deployment_local
* Command to run cloudfoundry: /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap_dev start

なんで。

まぁいいやと、下のコマンドで起動するらしいから実行!

hironemu$ /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap_dev start


なんか、cloud_controllerの起動に失敗してる?

Targeting deployment "devbox" with cloudfoundry home "/home/hironemu/cloudfoundry"
Setting up cloud controller environment
Using cloudfoundry config from /home/hironemu/cloudfoundry/.deployments/devbox/config
Executing /home/hironemu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap start cloud_controller redis_node dea neo4j_node neo4j_gateway mysql_gateway rabbitmq_node redis_gateway health_manager router mongodb_gateway mongodb_node mysql_node rabbitmq_gateway uaa -c /home/hironemu/cloudfoundry/.deployments/devbox/config -v /home/hironemu/cloudfoundry/vcap/bin -l /home/hironemu/cloudfoundry/.deployments/devbox/log


cloud_controller    :	 STOPPED
LOG:
 WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /home/hironemu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method CloudController::Application#task called at /home/hironemu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:214:in `initialize_tasks'
Rails Error: Unable to access log file. Please ensure that  exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
redis_node          :	 RUNNING
dea                 :	 RUNNING
neo4j_node          :	 RUNNING
neo4j_gateway       :	 RUNNING
mysql_gateway       :	 RUNNING
rabbitmq_node       :	 RUNNING
redis_gateway       :	 RUNNING
health_manager      :	 RUNNING
router              :	 RUNNING
mongodb_gateway     :	 RUNNING
mongodb_node        :	 RUNNING
mysql_node          :	 RUNNING
rabbitmq_gateway    :	 RUNNING
uaa                 :	 RUNNING

ステータスを確認してみる。

hironemu$ /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap_dev status
Targeting deployment "devbox" with cloudfoundry home "/home/hironemu/cloudfoundry"
Setting up cloud controller environment
Using cloudfoundry config from /home/hironemu/cloudfoundry/.deployments/devbox/config
Executing /home/hironemu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap status cloud_controller redis_node dea neo4j_node neo4j_gateway mysql_gateway rabbitmq_node redis_gateway health_manager router mongodb_gateway mongodb_node mysql_node rabbitmq_gateway uaa -c /home/hironemu/cloudfoundry/.deployments/devbox/config -v /home/hironemu/cloudfoundry/vcap/bin -l /home/hironemu/cloudfoundry/.deployments/devbox/log
cloud_controller    :	 RUNNING
redis_node          :	 RUNNING
dea                 :	 RUNNING
neo4j_node          :	 RUNNING
neo4j_gateway       :	 RUNNING
mysql_gateway       :	 RUNNING
rabbitmq_node       :	 RUNNING
redis_gateway       :	 RUNNING
health_manager      :	 RUNNING
router              :	 RUNNING
mongodb_gateway     :	 RUNNING
mongodb_node        :	 RUNNING
mysql_node          :	 RUNNING
rabbitmq_gateway    :	 RUNNING
uaa                 :	 RUNNING

あれ、動いてる。いいのかこれで。

とりあえず、最初のステップはここまででよしとしよう。
次は本当にこれが動いてるのかってことを確認してみるとする。




と思ってもう一回ステータス確認してみたら。

hironemu$ /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap_dev status
Targeting deployment "devbox" with cloudfoundry home "/home/hironemu/cloudfoundry"
Setting up cloud controller environment
Using cloudfoundry config from /home/hironemu/cloudfoundry/.deployments/devbox/config
Executing /home/hironemu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/hironemu/cloudfoundry/vcap/dev_setup/bin/vcap status cloud_controller redis_node dea neo4j_node neo4j_gateway mysql_gateway rabbitmq_node redis_gateway health_manager router mongodb_gateway mongodb_node mysql_node rabbitmq_gateway uaa -c /home/hironemu/cloudfoundry/.deployments/devbox/config -v /home/hironemu/cloudfoundry/vcap/bin -l /home/hironemu/cloudfoundry/.deployments/devbox/log
cloud_controller    :	 RUNNING
redis_node          :	 RUNNING
dea                 :	 RUNNING
neo4j_node          :	 RUNNING
neo4j_gateway       :	 RUNNING
mysql_gateway       :	 RUNNING
rabbitmq_node       :	 RUNNING
redis_gateway       :	 RUNNING
health_manager      :	 RUNNING
router              :	 RUNNING
mongodb_gateway     :	 RUNNING
mongodb_node        :	 RUNNING
mysql_node          :	 RUNNING
rabbitmq_gateway    :	 RUNNING
uaa                 :	 STOPPED

uaaが止まってるじゃないか。しかも一番最初ビルド失敗したときと関係ありそうなところが。。ログファイルみたらやっぱりビルドエラーになってるね。だめだ。これは。。



とりあえず、寝る。

追記(2012/04/25)

Cloudroundryのグループに、同じ現象を報告してくれている人がいて、解決方法ものってました。

Google グループ

cloudfoundry/vcap/uaa/pom.xmlを以下のように変更

<!--<spring.security.oauth.version>1.0.0.BUILD-SNAPSHOT</spring.security.oauth.version>-->
<spring.security.oauth.version>1.0.0.BUILD-20120418.070023-97</spring.security.oauth.version>

変更したら再起動

$ ./cloudfoundry/vcap/dev_setup/bin/vcap_dev stop
$ ./cloudfoundry/vcap/dev_setup/bin/vcap_dev start

すると、uaaのビルドが裏で走って、しばらくするとuaaのTomcatが起動する。下記のログで確認。

view ./.deployments/devbox/log/uaa.log

vcap_dev statusでステータスを確認るすと、uaaもRUNNINGになってる。やった。