title: How to fix the error in GCP CommandException: "lifecycle" command spanning providers not allowed
body: <p>I am learning GCP now. I have a bucket with the name of welynx-test1_copy
  I want to set a lifecycle policy to it so as the bucket would be deleted after 23 days, by following the command help I executed the following command in CLI:</p>
  
  <pre><code>xenonxie@cloudshell:~ (rock-perception-263016)$ gsutil ls
  gs://rock-perception-263016.appspot.com/
  gs://staging.rock-perception-263016.appspot.com/
  gs://welynx-test1/
  gs://welynx-test1_copy/
  </code></pre>
  
  <p>So you can see the bucket exists.</p>
  
  <p>Setting the policy below errors me out:</p>
  
  <pre><code>xenonxie@cloudshell:~ (rock-perception-263016)$ gsutil lifecycle set {"rule": [{"action": {"type": "Delete"}, "condition": {"age": 23}}]} gs://welynx-test1_copy
  </code></pre>
  
  <blockquote>
    <p>CommandException: "lifecycle" command spanning providers not allowed.</p>
  </blockquote>
  
  <p>I've tried to follow the syntax found in the <code>help</code> as below:</p>
  
  <blockquote>
    <p>xenonxie@cloudshell:~ (rock-perception-263016)$ gsutil lifecycle
    --help NAME   lifecycle - Get or set lifecycle configuration for a bucket</p>
    
    <p>SYNOPSIS   gsutil lifecycle get url   gsutil lifecycle set
    config-json-file url...</p>
    
    <p>DESCRIPTION   The lifecycle command can be used to get or set
    lifecycle management policies   for the given bucket(s). This command
    is supported for buckets only, not   objects. For more information on
    object lifecycle management, please see the   <code>Google Cloud Storage
    docs &lt;https://cloud.google.com/storage/docs/lifecycle&gt;</code>_.</p>
    
    <p>The lifecycle command has two sub-commands: GET   Gets the lifecycle
    configuration for a given bucket. You can get the   lifecycle
    configuration for only one bucket at a time. The output can be<br>
    redirected into a file, edited and then updated via the set
    sub-command.</p>
    
    <p>SET   Sets the lifecycle configuration on one or more buckets. The
    config-json-file   specified on the command line should be a path to a
    local file containing   the lifecycle configuration JSON document.</p>
    
    <p>EXAMPLES   The following lifecycle configuration JSON document
    specifies that all objects   in this bucket that are more than 365
    days old will be deleted automatically:</p>
  
  <pre><code>{
    "rule":
    [
      {
        "action": {"type": "Delete"},
        "condition": {"age": 365}
      }
    ]
  }
  </code></pre>
    
    <p>The following (empty) lifecycle configuration JSON document removes
    all   lifecycle configuration for a bucket:</p>
  
  <pre><code>{}
  </code></pre>
  </blockquote>
  
  <p>What am I missing here and how do I fix it? Thank you very much.</p>