Bug 867706 - [US2853]NoMethod error is shown if using rhc tail which rhc client API version is newer than server
[US2853]NoMethod error is shown if using rhc tail which rhc client API versio...
Status: CLOSED WONTFIX
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
libra bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-18 03:03 EDT by joycezhang
Modified: 2015-05-14 22:22 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-22 15:53:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description joycezhang 2012-10-18 03:03:00 EDT
Description of problem:
If try to use rhc commands with newer API version than server, all other commands can work well exept using rhc tail. Please refer to the error as below:
# rhc tail -a app9
Password: *

WARNING: API version mismatch. This client supports 1.0, 1.1, 1.2 
but server at ec2-23-20-167-201.compute-1.amazonaws.com supports 1.0.
/usr/local/share/gems/gems/rhc-0.99.7/lib/rhc/rest/application.rb:128:in `tail': undefined method `name' for nil:NilClass (NoMethodError)
	from /usr/local/share/gems/gems/rhc-0.99.7/lib/rhc/commands/tail.rb:17:in `run'
	from /usr/local/share/gems/gems/rhc-0.99.7/lib/rhc/commands.rb:129:in `block (3 levels) in to_commander'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
	from /usr/local/share/gems/gems/rhc-0.99.7/lib/rhc/command_runner.rb:58:in `run!'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
	from /usr/local/share/gems/gems/rhc-0.99.7/lib/rhc/cli.rb:40:in `start'
	from /usr/local/share/gems/gems/rhc-0.99.7/bin/rhc:21:in `<top (required)>'
	from /usr/local/bin/rhc:23:in `load'
	from /usr/local/bin/rhc:23:in `<main>'

Version-Release number of selected component (if applicable):
devenv_state_197
git clone latest rhc client and rake package on devenv_2341 (Which already contains changes for US2853 )


How reproducible:
always

Steps to Reproduce:
1. Launch an old stage instance, like stage 197 which supported API version is 1.0
2. Using latest rhc client with supported API version is newer, this client supports 1.0, 1.1, 1.2 
3. Try to use rhc tail
  
Actual results:
Error is shown.

Expected results:
"rhc tail" function can work well with following warning message shown.

WARNING: API version mismatch. This client supports 1.0, 1.1, 1.2
but server at ec2-23-20-167-201.compute-1.amazonaws.com supports 1.0

Additional info:
Comment 1 Hiro Asari 2012-10-19 14:54:40 EDT
The line in question is: https://github.com/openshift/rhc/blob/rhc-0.99.7-1/lib/rhc/rest/application.rb#L128

The message suggests that "cartridges" is somehow empty. The API version 1.0 should allow retrieval of cartridges, but we are getting an empty list. Since this server is only running a broker that supports API version 1.0, it is conceivable that it is a bug lies with the broker, rather than with the client. I tried connecting to the server mentioned, but was unable to.

What does:

    curl -H "Accept: application/json;version=1.0" https://openshift.redhat.com/broker/rest/api

return?

Looking at the returned data, look at the part that says: "LIST_CARTRIDGES". The hash value for that key has a pair that looks like:

"href":"https://openshift.redhat.com/broker/rest/cartridges"

Run:

  curl -H "Accept: application/json;version=1.0" https://openshift.redhat.com/broker/rest/cartridges # use the URL given above

And see if it returns anything. If it's blank, the broker is not holding up its end of the API contract, so there is not much the client can do.
Comment 2 joycezhang 2012-10-22 01:22:23 EDT
It's not blank when using rest api to get cartridges as below:

# curl -k -H "Accept: application/xml" --user "jinzhang+1:redhat" https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/api
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <version>1.0</version>
  <data>
    <link>
      <required-params/>
      <method>GET</method>
      <optional-params/>
      <rel>List cartridges</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/cartridges</href>
    </link>
    <link>
      <required-params/>
      <method>GET</method>
      <optional-params/>
      <rel>List application templates</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/application_template</href>
    </link>
    <link>
      <required-params>
        <param>
          <name>id</name>
          <valid-options/>
          <description>Name of the domain</description>
          <type>string</type>
        </param>
      </required-params>
      <method>POST</method>
      <optional-params/>
      <rel>Create new domain</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/domains</href>
    </link>
    <link>
      <required-params/>
      <method>GET</method>
      <optional-params/>
      <rel>Get user information</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/user</href>
    </link>
    <link>
      <required-params/>
      <method>GET</method>
      <optional-params/>
      <rel>API entry point</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/api</href>
    </link>
    <link>
      <required-params/>
      <method>GET</method>
      <optional-params/>
      <rel>List domains</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/domains</href>
    </link>
    <link>
      <required-params/>
      <method>GET</method>
      <optional-params/>
      <rel>List available estimates</rel>
      <href>https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/estimates</href>
    </link>
  </data>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
  </supported-api-versions>
  <messages/>
  <type>links</type>
  <status>ok</status>
</response>



# curl -k -H "Accept: application/xml" --user "jinzhang+1:redhat" https://ec2-50-17-95-47.compute-1.amazonaws.com/broker/rest/cartridges
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <version>1.0</version>
  <data>
    <cartridge>
      <name>nodejs-0.6</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>jbossas-7</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>python-2.6</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>jenkins-1.4</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>ruby-1.8</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>diy-0.1</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>php-5.3</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>perl-5.10</name>
      <type>standalone</type>
    </cartridge>
    <cartridge>
      <name>mongodb-2.0</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>cron-1.4</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>mysql-5.1</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>postgresql-8.4</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>haproxy-1.4</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>10gen-mms-agent-0.1</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>phpmyadmin-3.4</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>metrics-0.1</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>phpmoadmin-1.0</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>rockmongo-1.1</name>
      <type>embedded</type>
    </cartridge>
    <cartridge>
      <name>jenkins-client-1.4</name>
      <type>embedded</type>
    </cartridge>
  </data>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
  </supported-api-versions>
  <messages/>
  <type>cartridges</type>
  <status>ok</status>
</response>

So assign it back. Thanks.
Comment 3 Hiro Asari 2012-10-22 19:42:22 EDT
Please advise what version of AMI for the OpenShift server I should use to test this.

And also, please verify what the server reports in JSON.

Thank you.
Comment 4 Hiro Asari 2012-10-22 20:01:43 EDT
Using the latest AMI (devenv_2362) and rev e090ab3 (https://github.com/openshift/rhc/commit/e090ab39f0b289438e76ff82b7566aab866e9a19), I get:

$ RHC_DOMAIN=dev.rhcloud.com RHC_PASSWORD=testtest RHC_USERNAME=test16942891@example.com http_proxy='http://file.rdu.redhat.com:3128' bx bin/rhc tail -a foo                       
Password: 

==> ruby-1.9/logs/access_log-20121022-000000-EST <==
- - - [22/Oct/2012:18:37:38 -0400] "HEAD / HTTP/1.1" 200 - "-" "-"
- - - [22/Oct/2012:18:37:39 -0400] "HEAD / HTTP/1.1" 200 - "-" "-"
/usr/bin/tail: cannot open `ruby-1.9/logs/production.log' for reading: No such file or directory

==> ruby-1.9/logs/error_log-20121022-000000-EST <==
[Mon Oct 22 18:37:36 2012] [notice] SELinux policy enabled; httpd running as context system_u:system_r:openshift_t:s0:c0,c501
[Mon Oct 22 18:37:36 2012] [notice] mod_bw : Memory Allocated 32 bytes (each conf takes 32 bytes)
[Mon Oct 22 18:37:36 2012] [notice] mod_bw : Version 0.8 - Initialized [1 Confs]
[Mon Oct 22 18:37:36 2012] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 22 18:37:36 2012] [notice] Digest: done
[Mon Oct 22 18:37:36 2012] [notice] Apache/2.2.17 (Unix) Phusion_Passenger/3.0.12 configured -- resuming normal operations



Also, can you check with 0.99.8-1 or 0.99.9-1 and pass '-d' flag?
Comment 5 joycezhang 2012-10-22 22:32:26 EDT
This bug is occurred when the rhc client API version (1.0, 1.1, 1.2) is newer than the server API version (1.0). So we lanched devenv_stage_197 for this testing as the description. It works well with other rhc commands in this case, reasonable warning message are shown and functions are ok except using rhc tail.
Here are the steps for your reference:

Build:
devenv_stage_197 (Supported API 1.0)
Tested with following clients supported API 1.0, 1.1, 1.2
git clone latest rhc client and rake package on devenv_2341 (Which already contains changes for US2853 )
rhc-0.99.10
rhc-0.99.9

Steps:
1. Create an app.
2. Run rhc tail:
# rhc tail php5 -d 
Password: *

D, [2012-10-23T10:14:14.105619 #30123] DEBUG -- : Connecting to https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/api
D, [2012-10-23T10:14:14.106080 #30123] DEBUG -- : Checking API version 1.2
D, [2012-10-23T10:14:21.446318 #30123] DEBUG -- : Server does not support API version 1.2
D, [2012-10-23T10:14:21.446479 #30123] DEBUG -- : Checking API version 1.1
D, [2012-10-23T10:14:27.715449 #30123] DEBUG -- : Server does not support API version 1.1
D, [2012-10-23T10:14:27.715566 #30123] DEBUG -- : Checking API version 1.0
WARNING: API version mismatch. This client supports 1.0, 1.1, 1.2 
but server at ec2-23-21-16-1.compute-1.amazonaws.com supports 1.0.
D, [2012-10-23T10:14:33.838241 #30123] DEBUG -- : Getting all domains
D, [2012-10-23T10:14:33.838464 #30123] DEBUG -- : Request: #<RestClient::Request:0x00000002830b10 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T10:14:40.096682 #30123] DEBUG -- : Finding domain joycezpp
D, [2012-10-23T10:14:40.096863 #30123] DEBUG -- : Getting all domains
D, [2012-10-23T10:14:40.097044 #30123] DEBUG -- : Request: #<RestClient::Request:0x00000002a53528 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T10:14:46.481523 #30123] DEBUG -- : Finding application :name => php5, :framework => 
D, [2012-10-23T10:14:46.481617 #30123] DEBUG -- : Getting all applications for domain joycezpp
D, [2012-10-23T10:14:46.481794 #30123] DEBUG -- : Request: #<RestClient::Request:0x0000000294e150 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains/joycezpp/applications", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains/joycezpp/applications", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T10:14:52.896279 #30123] DEBUG -- : Tail in progress for php5
D, [2012-10-23T10:14:52.896376 #30123] DEBUG -- : Getting all cartridges for application php5
D, [2012-10-23T10:14:52.896574 #30123] DEBUG -- : Request: #<RestClient::Request:0x0000000299f438 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains/joycezpp/applications/php5/cartridges", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-21-16-1.compute-1.amazonaws.com/broker/rest/domains/joycezpp/applications/php5/cartridges", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMjph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
/usr/local/share/gems/gems/rhc-0.99.9/lib/rhc/rest/application.rb:128:in `tail': undefined method `name' for nil:NilClass (NoMethodError)
	from /usr/local/share/gems/gems/rhc-0.99.9/lib/rhc/commands/tail.rb:17:in `run'
	from /usr/local/share/gems/gems/rhc-0.99.9/lib/rhc/commands.rb:129:in `block (3 levels) in to_commander'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
	from /usr/local/share/gems/gems/rhc-0.99.9/lib/rhc/command_runner.rb:58:in `run!'
	from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
	from /usr/local/share/gems/gems/rhc-0.99.9/lib/rhc/cli.rb:40:in `start'
	from /usr/local/share/gems/gems/rhc-0.99.9/bin/rhc:21:in `<top (required)>'
	from /usr/local/bin/rhc:23:in `load'
	from /usr/local/bin/rhc:23:in `<main>'
Comment 6 Hiro Asari 2012-10-23 01:37:58 EDT
Thank you for the information.

Could you confirm that you had not added any cartridge after creating the app under the testing scenario?

If you have not, does the error persist if you add any cartridge?

If you have, does the same error message appear if the server's API versions include newer ones?
Comment 7 joycezhang 2012-10-23 02:54:57 EDT
Thanks for your quick feedback. Yes, I didn't add any cartridges to the app. 
I just tried to add mysql to the app, it's different as below:

# rhc tail php2 -d
Password: *

D, [2012-10-23T14:46:59.981790 #31543] DEBUG -- : Connecting to https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/api
D, [2012-10-23T14:46:59.982237 #31543] DEBUG -- : Checking API version 1.2
D, [2012-10-23T14:47:06.290124 #31543] DEBUG -- : Server does not support API version 1.2
D, [2012-10-23T14:47:06.290238 #31543] DEBUG -- : Checking API version 1.1
D, [2012-10-23T14:47:13.311712 #31543] DEBUG -- : Server does not support API version 1.1
D, [2012-10-23T14:47:13.311872 #31543] DEBUG -- : Checking API version 1.0
WARNING: API version mismatch. This client supports 1.0, 1.1, 1.2 
but server at ec2-23-22-220-228.compute-1.amazonaws.com supports 1.0.
D, [2012-10-23T14:47:19.470098 #31543] DEBUG -- : Getting all domains
D, [2012-10-23T14:47:19.470622 #31543] DEBUG -- : Request: #<RestClient::Request:0x00000002529a48 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T14:47:25.845845 #31543] DEBUG -- : Finding domain test197
D, [2012-10-23T14:47:25.845979 #31543] DEBUG -- : Getting all domains
D, [2012-10-23T14:47:25.846332 #31543] DEBUG -- : Request: #<RestClient::Request:0x00000002740f48 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T14:47:32.126967 #31543] DEBUG -- : Finding application :name => php2, :framework => 
D, [2012-10-23T14:47:32.127058 #31543] DEBUG -- : Getting all applications for domain test197
D, [2012-10-23T14:47:32.127244 #31543] DEBUG -- : Request: #<RestClient::Request:0x000000026384e8 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains/test197/applications", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains/test197/applications", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T14:47:38.587716 #31543] DEBUG -- : Tail in progress for php2
D, [2012-10-23T14:47:38.587837 #31543] DEBUG -- : Getting all cartridges for application php2
D, [2012-10-23T14:47:38.588024 #31543] DEBUG -- : Request: #<RestClient::Request:0x000000026b1730 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, @url="https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains/test197/applications/php2/cartridges", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @block_response=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @max_redirects=10, @processed_headers={"Accept"=>"application/json; version=1.0", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-22-220-228.compute-1.amazonaws.com/broker/rest/domains/test197/applications/php2/cartridges", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amluemhhbmcrMTph", "User-Agent"=>"rhc/0.99.9 (ruby 1.9.3; x86_64-linux)", "Accept"=>"application/json; version=1.0"}, :payload=>{}, :timeout=>nil}>
D, [2012-10-23T14:47:44.966999 #31543] DEBUG -- : ssh -t 501b7e2ecfb3414ba345a73b81d8a4bc@php2-test197.dev.rhcloud.com 'tail mysql-5.1/logs/*'
Could not find any files matching glob
Comment 8 Hiro Asari 2012-10-23 07:26:07 EDT
Chris, can you take a look?

Thank you.

https://github.com/openshift/rhc/commit/5e0d01553ec650e93fa258db6d810485b70a5eb9#commitcomment-2038243
Comment 9 chris alfonso 2012-10-23 08:33:26 EDT
When an application is created, there should be a standalone cartridge created, correct?  The list of cartridges is empty with the 1.0 server API.  The new api for tailing a log requires that we use the cartridge name in the path for the default file glob.  Perhaps in the case of the 1.0 server api, we should fall back to using the application name as the root directory for the file glob.

Even if we did have the standalone cartridge name with the 1.0 server API, if we tried to use the standalone cartridge name as the root directory for the file glob, it probably wouldn't work since it was as recent change to the broker that switched from the application name to the standalone cartridge name.

Hiro, do you concur?
Comment 10 Hiro Asari 2012-10-23 11:45:27 EDT
Chris,

If the 'tail' command requires API > 1.0 and there is nothing reasonable to show under such conditions, then we need to bail out. But if there is anything at all to show, I'd rather see that instead.
Comment 11 chris alfonso 2012-10-23 14:58:38 EDT
After discussing this with clayton, we will not be supporting an api previous to 1.2.  Furthermore, we will not have any servers running an api < 1.2.  We should however build into the rest client a method for each command to call if they required an api version, for use after the 1.2 api release.
Comment 12 Hiro Asari 2012-10-23 16:40:33 EDT
Given the above discussion, then, I am going to mark this bug as "WONTFIX", assuming that we will not encounter any OpenShift server that does not support 1.2 in the wild.
Comment 13 Clayton Coleman 2012-10-26 13:43:40 EDT
Hiro, this is the item we discussed earlier this sprint that you were going to own - adding support to the rest client to require a specific app version in a command by command basis (rest_client(:at_least => 1.2))
Comment 14 Hiro Asari 2012-10-29 16:55:17 EDT
Proposed change: https://github.com/openshift/rhc/pull/200
Comment 15 Wei Sun 2012-12-21 05:50:59 EST
Test on devenv_2621,rhc client is rhc 1.3.2

If client API version is changed to server supported lowest version 1.0, error "NilClass (NoMethodError)" is shown when using rhc tail.

[sunwei@dhcp-8-229 ~]$ rhc tail php
Password: ******
/home/sunwei/.gem/ruby/1.9.1/gems/rhc-1.3.2/lib/rhc/commands/tail.rb:21:in `run': undefined method `name' for nil:NilClass (NoMethodError)
    from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-1.3.2/lib/rhc/commands.rb:137:in `block (3 levels) in to_commander'
    from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
    from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
    from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
    from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
    from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-1.3.2/lib/rhc/command_runner.rb:61:in `run!'
    from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
    from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-1.3.2/lib/rhc/cli.rb:41:in `start'
    from /home/sunwei/.gem/ruby/1.9.1/gems/rhc-1.3.2/bin/rhc:21:in `<top (required)>'
    from /usr/local/bin/rhc:23:in `load'
    from /usr/local/bin/rhc:23:in `<main>'
Comment 16 Fabiano Franz 2013-07-22 15:53:20 EDT
Not an issue anymore on OSE since we only officially support 1.2.

Note You need to log in before you can comment on or make changes to this bug.