0

Ich erhalte diese Fehlermeldung:Nebel-Openstack Die Anforderung vorgenommenen erfordert Authentifizierung

Expected([201]) <=> Actual(401 Unauthorized) excon.error.response :body => "{\"error\": {\"message\": \"The request you have made requires authentication.\", \"code\": 401, \"title\": \"Unauthorized\"}}" :cookies => [ ] :headers => { "Cache-Control" => "no-cache, no-store, must-revalidate" "Content-Length" => "114" "Content-Security-Policy" => "default-src 'self'" "Content-Type" => "application/json" "Date" => "Sun, 01 Oct 2017 18:02:00 GMT" "Expires" => "0" "Pragma" => "no-cache" "Server" => "Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5" "Strict-Transport-Security" => "max-age=31536000" "Vary" => "X-Auth-Token" "WWW-Authenticate" => "Keystone uri=\"https://identity.open.softlayer.com\"" "X-Content-Type-Options" => "nosniff" "X-XSS-Protection" => "0" "x-openstack-request-id" => "req-2bef9760-51da-41d5-9c0f-a5fd6815ebae" } :host => "identity.open.softlayer.com" :local_address => "192.168.1.105" :local_port => 59391 :path => "/v3/auth/tokens" :port => 443 :reason_phrase => "Unauthorized" :remote_ip => "184.173.131.10" :status => 401 :status_line => "HTTP/1.1 401 Unauthorized\r\n" 

Und das ist die Spur:

excon (0.59.0) lib/excon/middlewares/expects.rb:7:in `response_call' 
excon (0.59.0) lib/excon/middlewares/response_parser.rb:9:in `response_call' 
excon (0.59.0) lib/excon/connection.rb:389:in `response' 
excon (0.59.0) lib/excon/connection.rb:253:in `request' 
fog-core (1.45.0) lib/fog/core/connection.rb:81:in `request' 
C:/Ruby24/lib/ruby/gems/2.4.0/bundler/gems/fog-openstack-3d5f4ea27a41/lib/fog/openstack.rb:527:in `retrieve_tokens_v3' 
C:/Ruby24/lib/ruby/gems/2.4.0/bundler/gems/fog-openstack-3d5f4ea27a41/lib/fog/openstack.rb:275:in `authenticate_v3' 
C:/Ruby24/lib/ruby/gems/2.4.0/bundler/gems/fog-openstack-3d5f4ea27a41/lib/fog/openstack.rb:152:in `authenticate' 
C:/Ruby24/lib/ruby/gems/2.4.0/bundler/gems/fog-openstack-3d5f4ea27a41/lib/fog/openstack/core.rb:182:in `authenticate' 
C:/Ruby24/lib/ruby/gems/2.4.0/bundler/gems/fog-openstack-3d5f4ea27a41/lib/fog/storage/openstack.rb:98:in `initialize' 

ich here einen Blick nahm, herauszufinden, um zu versuchen, Was könnte es zur Authentifizierung fehlen, aber ich kann es nicht finden.

Diese Locke arbeitet curl -i -H "Content-Type: application/json" -d @bm.json https://identity.open.softlayer.com/v3/auth/tokens

Wo bm.json ist:

{ 
    "auth": { 
     "identity": { 
      "methods": [ 
       "password" 
      ], 
     "password": { 
       "user": { 
        "id": "1a5...", 
       "password": "O_C..." 
      } 
      } 
     }, 
    "scope": { 
      "project": { 
       "id": "b71..." 
     } 
     } 
    } 
} 

So sollte es genug sein, dies zu senden:

openstack_auth_url: "https://identity.open.softlayer.com/v3/auth/tokens", 
openstack_api_key:  "O_C...", 
openstack_userid:  "1a5...", 
openstack_project_id: "b71...", 

Was bin ich?

Antwort

0

Da Sie v3 verwenden, empfehlen ihre docs Einstellung:

@connection_params = { 
    openstack_auth_url:  "http://devstack.test:5000/v3/auth/tokens", 
    openstack_username:  "admin", 
    openstack_api_key:  "password", 
    openstack_project_name: "admin", 
    openstack_domain_id: "default" 
} 

ich es testen würde wieder Benutzernamen anstelle von Benutzer-ID, project_name statt project_id mit aus, und die domain_id angeben. Die Authentifizierungsinformationen sollten in Ihren Dienstanmeldeinformationen enthalten sein.

Verwandte Themen