{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1451","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1451/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1451/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1451/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/1451","id":167603566,"number":1451,"title":"Bigtable - issue with table.exists when creating a table then adding a family","user":{"login":"dom-white","id":16900548,"avatar_url":"https://avatars.githubusercontent.com/u/16900548?v=3","gravatar_id":"","url":"https://api.github.com/users/dom-white","html_url":"https://github.com/dom-white","followers_url":"https://api.github.com/users/dom-white/followers","following_url":"https://api.github.com/users/dom-white/following{/other_user}","gists_url":"https://api.github.com/users/dom-white/gists{/gist_id}","starred_url":"https://api.github.com/users/dom-white/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dom-white/subscriptions","organizations_url":"https://api.github.com/users/dom-white/orgs","repos_url":"https://api.github.com/users/dom-white/repos","events_url":"https://api.github.com/users/dom-white/events{/privacy}","received_events_url":"https://api.github.com/users/dom-white/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/labels/bigtable","name":"bigtable","color":"006b75"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"callmehiphop","id":1707267,"avatar_url":"https://avatars.githubusercontent.com/u/1707267?v=3","gravatar_id":"","url":"https://api.github.com/users/callmehiphop","html_url":"https://github.com/callmehiphop","followers_url":"https://api.github.com/users/callmehiphop/followers","following_url":"https://api.github.com/users/callmehiphop/following{/other_user}","gists_url":"https://api.github.com/users/callmehiphop/gists{/gist_id}","starred_url":"https://api.github.com/users/callmehiphop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmehiphop/subscriptions","organizations_url":"https://api.github.com/users/callmehiphop/orgs","repos_url":"https://api.github.com/users/callmehiphop/repos","events_url":"https://api.github.com/users/callmehiphop/events{/privacy}","received_events_url":"https://api.github.com/users/callmehiphop/received_events","type":"User","site_admin":false},"assignees":[{"login":"callmehiphop","id":1707267,"avatar_url":"https://avatars.githubusercontent.com/u/1707267?v=3","gravatar_id":"","url":"https://api.github.com/users/callmehiphop","html_url":"https://github.com/callmehiphop","followers_url":"https://api.github.com/users/callmehiphop/followers","following_url":"https://api.github.com/users/callmehiphop/following{/other_user}","gists_url":"https://api.github.com/users/callmehiphop/gists{/gist_id}","starred_url":"https://api.github.com/users/callmehiphop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmehiphop/subscriptions","organizations_url":"https://api.github.com/users/callmehiphop/orgs","repos_url":"https://api.github.com/users/callmehiphop/repos","events_url":"https://api.github.com/users/callmehiphop/events{/privacy}","received_events_url":"https://api.github.com/users/callmehiphop/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-07-26T13:12:39Z","updated_at":"2016-07-26T17:30:49Z","closed_at":null,"body":"Hi, it's great to see the new Bigtable functionality added, but I am having an issue checking and creating tables.\r\n\r\nI can successfully use table.create() and then call table.createFamily() from it's callback function, but I get an error on creation of the 'family' if I have just happened to test whether the table exists first.\r\n\r\n#### Environment details\r\n\r\n  - OS: Ubuntu 16.04\r\n  - Node.js version: v6.1.0\r\n  - npm version: 3.8.6\r\n  - gcloud-node version: v0.37.0\r\n\r\n#### Steps to reproduce\r\n\r\n```js\r\nvar table = bigtable.table('prezzy');\r\n\r\ntable.exists(function(err, exists) {\r\n    if (exists) {\r\n        console.log(\"Table already exists\");\r\n    } else {\r\n        table.create(function(err, table, apiResponse) {\r\n            if (err) {\r\n                console.log(\"Error from table.create(): \" + err);\r\n            } else {\r\n                console.log(\"Table created, now create family\");\r\n\r\n                table.createFamily('follows', function(err, family) {\r\n                    if (err) {\r\n                        console.log(\"Error from table.createFamily(): \" + err);\r\n                    } else {\r\n                        console.log(\"family created\");\r\n                    }\r\n                });\r\n            }\r\n        });\r\n    }\r\n});\r\n```\r\nIn this case I get \r\n```\r\nTable created, now create family\r\nError from table.createFamily(): Error: Failed to read: projects/{12345678}/instances//clusters/my-cluster/tables/prezzy\r\n```\r\n\r\nIf I simply remove the 'exists' test it works (obviously if the table does not exist. I am deleting the table between the tests)\r\n```js\r\nvar table = bigtable.table('prezzy');\r\n\r\ntable.create(function(err, table, apiResponse) {\r\n\r\n    if (err) {\r\n        console.log(\"Error from table.create(): \" + err);\r\n    } else {\r\n        console.log(\"Table created, now create family\");\r\n\r\n        table.createFamily('follows', function(err, family) {\r\n            if (err) {\r\n                console.log(\"Error from table.createFamily(): \" + err);\r\n            } else {\r\n                console.log(\"family created\");\r\n            }\r\n        });\r\n    }\r\n});\r\n```\r\n\r\nThis code produces the expected result\r\n```\r\nTable created, now create family\r\nfamily created\r\n```\r\n\r\nIt would seem that the use of the 'exists' API call is changing the nature of the 'table' object\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/comments/235343316","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/1451#issuecomment-235343316","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1451","id":235343316,"user":{"login":"callmehiphop","id":1707267,"avatar_url":"https://avatars.githubusercontent.com/u/1707267?v=3","gravatar_id":"","url":"https://api.github.com/users/callmehiphop","html_url":"https://github.com/callmehiphop","followers_url":"https://api.github.com/users/callmehiphop/followers","following_url":"https://api.github.com/users/callmehiphop/following{/other_user}","gists_url":"https://api.github.com/users/callmehiphop/gists{/gist_id}","starred_url":"https://api.github.com/users/callmehiphop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmehiphop/subscriptions","organizations_url":"https://api.github.com/users/callmehiphop/orgs","repos_url":"https://api.github.com/users/callmehiphop/repos","events_url":"https://api.github.com/users/callmehiphop/events{/privacy}","received_events_url":"https://api.github.com/users/callmehiphop/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T17:30:49Z","updated_at":"2016-07-26T17:30:49Z","body":"@dom-white thanks for opening this issue, I was able to produce this locally using your provided steps! Interestingly enough if I use a `setTimeout` to delay creating the family by about 10 seconds, everything passes, anything less and I receive the same error.\r\n\r\n@lesv Any idea why this might be happening?"}}
{"actor":{"display_login":"callmehiphop"}}