Repository: google/turbinia

Issue:
Instance ID not being set correctly
```
$ turbiniactl -w -a -p 10 directory -l /tmp/
```
And on the turbinia server side:
```
$ turbiniactl server
<SNIP>
[INFO] Adding PSQ task GrepTask with evidence PlasoCsvFile to queue
[DEBUG] Updating Task PsortTask in Datastore
[DEBUG] Updating Task GrepTask in Datastore

[INFO] 0 Tasks still outstanding.
[ERROR] Task GrepTask from hostname.machine was not successful
[DEBUG] Updating Task GrepTask in Datastore
```

The log file is:
```
~$ cat /mnt/turbinia/output/1534209775-0af2e32809684b019cde47a1b1d27b54-GrepTask/worker-log.txt
No patterns supplied, exit task
```



Discussion:
In turbinia/turbiniactl.py changing 
`instance=config.PUBSUB_TOPIC,` to `instance=config.INSTANCE_ID,`
seems to fix the "0 Tasks found, 1 completed. Waiting 10 seconds." from the client

Yeah, it looks like when the INSTANCE_ID config var was added as part of the "local" installation type, that it didn't get changed for the cloud/hybrid types at the same time, and before that we were just using the PUBSUB_TOPIC since it was a unique string.  I'll send a PR, thanks!

Resolving patch:
diff --git a/turbinia/client.py b/turbinia/client.py
--- a/turbinia/client.py
+++ b/turbinia/client.py
@@ -75,7 +75,7 @@ def wait_for_request(self,
 
     Args:
       instance (string): The Turbinia instance name (by default the same as the
-          PUBSUB_TOPIC in the config).
+          INSTANCE_ID in the config).
       project (string): The name of the project.
       region (string): The name of the region to execute in.
       request_id (string): The Id of the request we want tasks for.
@@ -116,7 +116,7 @@ def get_task_data(self,
 
     Args:
       instance (string): The Turbinia instance name (by default the same as the
-          PUBSUB_TOPIC in the config).
+          INSTANCE_ID in the config).
       project (string): The name of the project.
       region (string): The name of the region to execute in.
       days (int): The number of days we want history for.
@@ -177,7 +177,7 @@ def format_task_status(self,
 
     Args:
       instance (string): The Turbinia instance name (by default the same as the
-          PUBSUB_TOPIC in the config).
+          INSTANCE_ID in the config).
       project (string): The name of the project.
       region (string): The name of the zone to execute in.
       days (int): The number of days we want history for.
@@ -245,7 +245,7 @@ def close_tasks(self,
 
     Args:
       instance (string): The Turbinia instance name (by default the same as the
-          PUBSUB_TOPIC in the config).
+          INSTANCE_ID in the config).
       project (string): The name of the project.
       region (string): The name of the zone to execute in.
       request_id (string): The Id of the request we want tasks for.
@@ -303,7 +303,7 @@ def get_task_data(self,
 
     Args:
       instance (string): The Turbinia instance name (by default the same as the
-          PUBSUB_TOPIC in the config).
+          INSTANCE_ID in the config).
       days (int): The number of days we want history for.
       task_id (string): The Id of the task.
       request_id (string): The Id of the request we want tasks for.
diff --git a/turbinia/state_manager.py b/turbinia/state_manager.py
--- a/turbinia/state_manager.py
+++ b/turbinia/state_manager.py
@@ -210,7 +210,7 @@ def get_task_data(self, instance, days=0, task_id=None, request_id=None):
 
     Args:
       instance (string): The Turbinia instance name (by default the same as the
-          PUBSUB_TOPIC in the config).
+          INSTANCE_ID in the config).
       days (int): The number of days we want history for.
       task_id (string): The Id of the task.
       request_id (string): The Id of the request we want tasks for.
diff --git a/turbinia/turbiniactl.py b/turbinia/turbiniactl.py
--- a/turbinia/turbiniactl.py
+++ b/turbinia/turbiniactl.py
@@ -375,7 +375,7 @@ def main():
     if args.close_tasks:
       if args.user or args.request_id or args.task_id:
         print client.close_tasks(
-            instance=config.PUBSUB_TOPIC,
+            instance=config.INSTANCE_ID,
             project=config.PROJECT,
             region=region,
             request_id=args.request_id,
@@ -391,7 +391,7 @@ def main():
 
     if args.wait and args.request_id:
       client.wait_for_request(
-          instance=config.PUBSUB_TOPIC,
+          instance=config.INSTANCE_ID,
           project=config.PROJECT,
           region=region,
           request_id=args.request_id,
@@ -402,7 +402,7 @@ def main():
                'turbiniactl will exit without waiting.')
 
     print client.format_task_status(
-        instance=config.PUBSUB_TOPIC,
+        instance=config.INSTANCE_ID,
         project=config.PROJECT,
         region=region,
         days=args.days_history,
@@ -465,13 +465,13 @@ def main():
           request.request_id))
       region = config.TURBINIA_REGION
       client.wait_for_request(
-          instance=config.PUBSUB_TOPIC,
+          instance=config.INSTANCE_ID,
           project=config.PROJECT,
           region=region,
           request_id=request.request_id,
           poll_interval=args.poll_interval)
       print client.format_task_status(
-          instance=config.PUBSUB_TOPIC,
+          instance=config.INSTANCE_ID,
           project=config.PROJECT,
           region=region,
           request_id=request.request_id,


Test patch: