Git Product home page Git Product logo

Comments (10)

ikehz avatar ikehz commented on June 14, 2024

+1. I can't take this on, but it'd be great to have it done. Do you know if this is a generic problem, or something specific to fog-google and/or Server?

from fog-google.

Temikus avatar Temikus commented on June 14, 2024

This seems to be a more generic problem :/

If we analyze the body of the 503 received, we see that the response is not actually that coherent.
It essentially reports that the operation has failed, but doesn't specify why or at what stage.

pry(#<Fog::Compute::Google::Real>)> body
=> {"kind"=>"compute#operation",
 "id"=>"3654193698946290258",
 "name"=>"operation-1434376924665-5188ee71194a9-7bb7cfb5-713bc80d",
 "zone"=>"https://www.googleapis.com/compute/v1/projects/dev-utility-90115/zones/europe-west1-b",
 "operationType"=>"insert",
 "targetLink"=>
  "https://www.googleapis.com/compute/v1/projects/dev-utility-90115/zones/europe-west1-b/instances/fog-smoke-test-1434376921",
 "status"=>"DONE",
 "user"=>"768099535741-jcfc4jlatsvelvosl2cgmqcsqoep3d1k@developer.gserviceaccount.com",
 "progress"=>100,
 "insertTime"=>"2015-06-15T07:02:05.269-07:00",
 "startTime"=>"2015-06-15T07:02:05.624-07:00",
 "endTime"=>"2015-06-15T07:02:11.495-07:00",
 "error"=>
  {"errors"=>
    [{"code"=>"INTERNAL_ERROR", "message"=>"Code: 'CghJTlNUQU5DRRImNzY4MDk5NTM1NzQxLmZvZy1zbW9rZS10ZXN0LTE0MzQzNzY5MjE='"}]},
 "httpErrorStatusCode"=>503,
 "httpErrorMessage"=>"SERVICE UNAVAILABLE",
 "selfLink"=>
  "https://www.googleapis.com/compute/v1/projects/dev-utility-90115/zones/europe-west1-b/operations/operation-1434376924665-5188ee71194a9-7bb7cfb5-713bc80d"}
[4] pry(#<Fog::Compute::Google::Real>)> continue
/home/temikus/code/fog-google/lib/fog/google.rb:223:in `build_excon_response': Code: 'CghJTlNUQU5DRRImNzY4MDk5NTM1NzQxLmZvZy1zbW9rZS10ZXN0LTE0MzQzNzY5MjE=' (Fog::Errors::Error)
    from /home/temikus/code/fog-google/lib/fog/google.rb:193:in `request'
    from /home/temikus/code/fog-google/lib/fog/google/requests/compute/get_zone_operation.rb:50:in `get_zone_operation'
    from /home/temikus/code/fog-google/lib/fog/google/models/compute/operations.rb:23:in `get'
    from /home/temikus/code/fog-google/lib/fog/google/models/compute/server.rb:285:in `save'
    from /home/temikus/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/fog-core-d117cd252d28/lib/fog/core/collection.rb:51:in `create'
    from example_create.rb:22:in `test'
    from example_create.rb:60:in `<main>'

And, as I indicated earlier, error code doesn't actually make sense:

pry(main)> Base64.decode64("CghJTlNUQU5DRRImNzY4MDk5NTM1NzQxLmZvZy1zbW9rZS10ZXN0LTE0MzQzNzY5MjE=")
=> "\n\bINSTANCE\x12&768099535741.fog-smoke-test-1434376921"

from fog-google.

icco avatar icco commented on June 14, 2024

My guess would be that this is an issue in excon plus an issue with how the google api outputs errors?

from fog-google.

ikehz avatar ikehz commented on June 14, 2024

@icco that sounds right. @Temikus, if you want to dig around directly with the API, you can do that at the bottom of the API reference.

from fog-google.

Temikus avatar Temikus commented on June 14, 2024

Thanks for the link, Ike! 👍

So, I did some digging around, and I see some strange stuff.
If we create a POST request to insert an instance with incorrect parameters:

POST https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances?key={MY_API_KEY}

{
 "machineType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/machineTypes/n1-standard-1",
 "name": "instance-1",
 "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f",
 "metadata": {
  "items": [
  ]
 },
 "tags": {
  "items": [
  ]
 },
 "disks": [
  {
   "type": "PERSISTENT",
   "boot": true,
   "mode": "READ_WRITE",
   "deviceName": "instance-1",
   "autoDelete": true,
   "initializeParams": {
    "sourceImage": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20150603",
    "diskType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/diskTypes/pd-standard"
   }
  }
 ],
 "canIpForward": false,
 "networkInterfaces": [
  {
   "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default",
   "accessConfigs": [
    {
     "name": "External NAT",
     "type": "ONE_TO_ONE_NAT"
    }
   ]
  }
 ],
 "description": "",
 "scheduling": {
  "preemptible": false,
  "onHostMaintenance": "MIGRATE",
  "automaticRestart": true
 },
 "serviceAccounts": [
  {
   "email": "default",
   "scopes": [
    "https://www.googleapis.com/auth/devstorage.read_only",
    "https://www.googleapis.com/auth/bazynga"
   ]
  }
 ]
}

We get a 200 OK link back with the operation:

200 OK

{
 "kind": "compute#operation",
 "id": "15925425956635618016",
 "name": "operation-1434388773478-51891a9501e70-824f09b6-b54977c7",
 "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f",
 "operationType": "insert",
 "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances/instance-1",
 "status": "PENDING",
 "user": "[email protected]",
 "progress": 0,
 "insertTime": "2015-06-15T10:19:34.161-07:00",
 "startTime": "2015-06-15T10:19:34.379-07:00",
 "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/operations/operation-1434388773478-51891a9501e70-824f09b6-b54977c7"
}

But the operation itself never succeeds, nor exits with a sane error code:

{
  "kind": "compute#operation",
  "id": "15925425956635618016",
  "name": "operation-1434388773478-51891a9501e70-824f09b6-b54977c7",
  "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f",
  "operationType": "insert",
  "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances/instance-1",
  "status": "DONE",
  "user": "[email protected]",
  "progress": 100,
  "insertTime": "2015-06-15T10:19:34.161-07:00",
  "startTime": "2015-06-15T10:19:34.379-07:00",
  "endTime": "2015-06-15T10:19:42.754-07:00",
  "error": {
    "errors": [
      {
        "code": "INTERNAL_ERROR",
        "message": "Code: 'CghJTlNUQU5DRRIXMjg4Mjc4OTg1ODI3Lmluc3RhbmNlLTE='"
      }
    ]
  },
  "httpErrorStatusCode": 503,
  "httpErrorMessage": "SERVICE UNAVAILABLE",
  "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/operations/operation-1434388773478-51891a9501e70-824f09b6-b54977c7"
}

This really looks like an issue on GCE side to me - what do you guys think?

from fog-google.

ikehz avatar ikehz commented on June 14, 2024

Yup; looks like a GCE bug to me. I'd go ahead and file a bug against GCE.

On Mon, Jun 15, 2015 at 10:26 AM, Artem Yakimenko [email protected]
wrote:

Thanks for the link, Ike! [image: 👍]

So, I did some digging around, and I see some strange stuff.
If we create a POST request to insert an instance with incorrect
parameters:

POST https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances?key={MY_API_KEY}

{
"machineType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/machineTypes/n1-standard-1",
"name": "instance-1",
"zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f",
"metadata": {
"items": [
]
},
"tags": {
"items": [
]
},
"disks": [
{
"type": "PERSISTENT",
"boot": true,
"mode": "READ_WRITE",
"deviceName": "instance-1",
"autoDelete": true,
"initializeParams": {
"sourceImage": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20150603",
"diskType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/diskTypes/pd-standard"
}
}
],
"canIpForward": false,
"networkInterfaces": [
{
"network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default",
"accessConfigs": [
{
"name": "External NAT",
"type": "ONE_TO_ONE_NAT"
}
]
}
],
"description": "",
"scheduling": {
"preemptible": false,
"onHostMaintenance": "MIGRATE",
"automaticRestart": true
},
"serviceAccounts": [
{
"email": "default",
"scopes": [
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/bazynga"
]
}
]
}

We get a 200 OK link back with the operation:

200 OK

{
"kind": "compute#operation",
"id": "15925425956635618016",
"name": "operation-1434388773478-51891a9501e70-824f09b6-b54977c7",
"zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f",
"operationType": "insert",
"targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances/instance-1",
"status": "PENDING",
"user": "[email protected]",
"progress": 0,
"insertTime": "2015-06-15T10:19:34.161-07:00",
"startTime": "2015-06-15T10:19:34.379-07:00",
"selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/operations/operation-1434388773478-51891a9501e70-824f09b6-b54977c7"
}

But the operation itself never succeeds, nor exits with a sane error code:

{
"kind": "compute#operation",
"id": "15925425956635618016",
"name": "operation-1434388773478-51891a9501e70-824f09b6-b54977c7",
"zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f",
"operationType": "insert",
"targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/instances/instance-1",
"status": "DONE",
"user": "[email protected]",
"progress": 100,
"insertTime": "2015-06-15T10:19:34.161-07:00",
"startTime": "2015-06-15T10:19:34.379-07:00",
"endTime": "2015-06-15T10:19:42.754-07:00",
"error": {
"errors": [
{
"code": "INTERNAL_ERROR",
"message": "Code: 'CghJTlNUQU5DRRIXMjg4Mjc4OTg1ODI3Lmluc3RhbmNlLTE='"
}
]
},
"httpErrorStatusCode": 503,
"httpErrorMessage": "SERVICE UNAVAILABLE",
"selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-f/operations/operation-1434388773478-51891a9501e70-824f09b6-b54977c7"
}

This really looks like an issue on GCE side to me - what do you guys think?


Reply to this email directly or view it on GitHub
#45 (comment).

from fog-google.

Temikus avatar Temikus commented on June 14, 2024

Bugs filed, I'll follow up on it.

from fog-google.

Temikus avatar Temikus commented on June 14, 2024

Status Update: no updates on the GCE bug filed, but the issue stopped reproducing in certain scenarios. Currently following up with GCE to verify what changed.

from fog-google.

Temikus avatar Temikus commented on June 14, 2024

Ok, this has somehow fixed itself, now the operation returns the correct data with the same request as above:
One or more service account scopes are invalid: 'https://www.googleapis.com/auth/bazynga'

I'll follow-up internally again tomorrow.

from fog-google.

Temikus avatar Temikus commented on June 14, 2024

This was fixed on Google's side by an unrelated change and released a couple of weeks ago, hence the new behaviour. Closing.

from fog-google.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.