[nvx_sds api] "RuntimeError: Invalid Session Token:..."

Last post 10-07-2008 6:00 AM by BarryR. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 12-01-2007 6:23 PM

    [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    Subject: [nvx_sds api] "RuntimeError: Invalid Session Token:..."
    error when use newly created session.

    Description:
    I want to use Ruby nvx_sds library, but after successfully creating a
    session, I can't use this session. It keeps throwing error:
    RuntimeError: Invalid Session Token...

    Reproduce steps:
    1. run irb
    2. Enter following command
    a) require 'nvx_sds'
    b) include NVX::SDS
    > session = Session.new("XXXXXXXXXXXXXXXXXX","XXXXXXX", "XXXXXXX","XXXXXXX")
    => Print out session details:
    => #<NVX::SDS::Session:0x34b7fb4 @account_login=#<NVX::SDS::AccountLogin:0x34b7f
    8c @username="XXXXXXX", @impersonation=false,
    app_key="XXXXXXXX",
    @session_token="213a5e68-540e-42d3-9ac9-e913c07550e4",
    @app_name="XXXXXXX", @password="XXXXXXX">>

    c) Now call any command, for example:
    > root_folder = session.GetRootFolder(1, 500, 0, true)
    => error:
    RuntimeError: Invalid Session Token:
    213a5e68-540e-42d3-9ac9-e913c07550e4,bbc5e999-c0d8-426c-820d-0c2699e69862

    Seem like the library add more data into the generated Session Token,
    and it cause the token not correct.

    Please check this and advice on how to fix this.
  • 12-04-2007 8:21 AM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    This could be related to an outdated library or invalid login credentials.  The login method takes appKey, username, appliaction name, password as the parameters. 

    Using the same calls as above with the latest library retrieved from rubyforge I get:

    irb(main):010:0> root_folder = session.GetRootFolder(1, 500, 0, true)
    => #<NVX::SDS::Folder:0x31b85e8 @fs_folder_list=#<NVX::SDS::FSFolderList:0x2e05a
    e0 @file_attributes=[#<NVX::SDS::FSFileAttributes:0x2e54564 @created_date="Sun, ... (quite a bit more as well)

    Let me know if you have the latest version and have verified your login credentials using:

    http://services.nirvanix.com/ws/authentication/Login.ashx?appKey=XXXX&username=XXXX&password=XXXX

    Regards,
        Barry R.
     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 12-20-2007 4:15 PM In reply to

    • joergd
    • Top 75 Contributor
    • Joined on 12-20-2007
    • Posts 4

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    I am running the latest gem (downloaded this morning), and am having the same difficulties. So I can log in successfully, but when I logout say, it throws an invalid session token exception. Also the session token in the exception, has the session I get when I log in, and another comma separated session ID ??? RuntimeError: Invalid Session Token: f6cea95d-d7ca-4aa7-88ef-5f8515f0fa8f,b40f7de8-77fe-4088-af54-aec13811ed20 Joerg
  • 12-20-2007 6:35 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    I recreated the steps above and called session.Logout after getting a successful login and the result is as expected.  Please include all of the steps you followed so I can try to reproduce this problem.

    Regards,
         Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 12-21-2007 10:30 AM In reply to

    • joergd
    • Top 75 Contributor
    • Joined on 12-20-2007
    • Posts 4

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    Hi Barry, This is what I did on the console: >> require 'nvx_sds' => [] >> session = NVX::SDS::Session.new("XXXXXXXXXXXXXXXXXXXXXXXX", "my_username", "my_app_name", "my_password") => #> >> session.Logout RuntimeError: Invalid Session Token: 2eaf3819-1b29-4b79-80c1-fcbcec630940,cbc49208-2db4-4e6e-93cd-b1dc1d2abf5f from /opt/local/lib/ruby/gems/1.8/gems/nvx-sds-1.1.0/lib/nvx/sds/transport.rb:72:in `execute_command_post' from /opt/local/lib/ruby/gems/1.8/gems/nvx-sds-1.1.0/lib/nvx/sds/transport.rb:68:in `execute_command_post' from /opt/local/lib/ruby/gems/1.8/gems/nvx-sds-1.1.0/lib/nvx/sds/session.rb:38:in `Logout' from (irb):18 >> J
  • 12-21-2007 6:32 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

     
    Try running this application:

    require 'nvx_sds'

    include NVX::SDS

    APP_KEY = 'YOUR-APP-KEY'
    USERNAME = 'testuser'
    APP_NAME = 'Test App'
    PASSWORD = 'testpassword'

    session = Session.new(APP_KEY, USERNAME, APP_NAME, PASSWORD)
    session.Logout


    Put this in a file test.rb and run "ruby test.rb" and let me know the results.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 01-02-2008 9:54 AM In reply to

    • joergd
    • Top 75 Contributor
    • Joined on 12-20-2007
    • Posts 4

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    My result, running it line-by-line through the Rails console. RuntimeError: Invalid Session Token: f323486f-708a-4954-bca1-15db5ecd5110,3d65fd71-94b8-46f8-ab36-91a34597345f from /opt/local/lib/ruby/gems/1.8/gems/nvx-sds-1.1.0/lib/nvx/sds/transport.rb:72:in `execute_command_post' from /opt/local/lib/ruby/gems/1.8/gems/nvx-sds-1.1.0/lib/nvx/sds/transport.rb:68:in `execute_command_post' from /opt/local/lib/ruby/gems/1.8/gems/nvx-sds-1.1.0/lib/nvx/sds/session.rb:38:in `Logout' from (irb):4 Joerg
  • 01-02-2008 2:59 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

     Ok, this will help me to identify the issue.  I'm going to try the application on a few different environments.  I see you are running 1.8.  Whats the exact version of ruby 1.8.6?  Also, what OS are you on Linux/FreeBSD and any specific information about your Linux distro would be helpful as well.  I normally use Debian or Unbuntu to develop on.

    Thanks for your patience as I try to understand what the problem is,
        Barry R.

     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 01-02-2008 3:29 PM In reply to

    • joergd
    • Top 75 Contributor
    • Joined on 12-20-2007
    • Posts 4

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    Hi Barry, My Ruby version is: ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin9.0.0] Developing off OS X Leopard. Joerg
  • 01-07-2008 5:47 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

     Ok, we have a developer running OS X Leopard as well.  I will have them take a look as soon as possible.

    Thanks,
         Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 01-12-2008 1:28 AM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    The result from IRB on a OS X Leopard running 1.8.6 b11 is as follows:

    => #<NVX::SDS::Session:0x112a330 @account_login=#<NVX::SDS::AccountLogin:0x112a308 @session_token="XXXXX", @app_name="XXXX", @password="XXXX", @username="XXXXX", @impersonation=false, @app_key="XXXXXX">>
    >> session.Logout
    => nil
    >>

    I'm not sure what the issue is but I built ruby from source and ran the test without an error.  For now i'm going to assume there is a problem with your environment.

    Please let me know if you have any additional information that would help us solve this issue because at this point i'm not sure what else I can do to help you.  Perhaps you can look at the unit tests in the Gem and try executing them.  As of the release they were all working.

    Regards,
         Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 10-07-2008 5:52 AM In reply to

    • bhups
    • Top 150 Contributor
    • Joined on 10-07-2008
    • Posts 2

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

    I was getting the same error. Then I came to know that transport.rb contains following line which is causing the problem:

    def Transport.execute_command_post(apicommand, apiparams, account_login)

    ----


    ----

                   apiparams << APIParam.new("sessionToken", account_login.session_token) if !account_login.nil?


    -----

    ----

    end

     

    So this line adds new sessionToken parameter to the parameter lists even if it was already present.. (thats why duplicate data is coming).

  • 10-07-2008 6:00 AM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: [nvx_sds api] "RuntimeError: Invalid Session Token:..."

     This is a good find, I will make sure to check to see if the session token has already been added before automatically adding the session token from the account_login.  This should make the Ruby library a little more robust for people not wanting to use the built in session management.

    Thanks,
          Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
Page 1 of 1 (13 items)