Skip to content

Getting this error "containerName" is a required option, but it was not provided" when listing out the objects #163

Closed

Description

@thatipelli69

Object creation and downloading are working properly but I got issues when get the object details (like content type, length etc)
Code which is throwing the error :
$container = $openstack->objectStoreV1()
->getContainer($this->container_name);

foreach ($container->listObjects() as $object) {
$data = $object->retrieve();
var_dump($data);
}

Activity

  1. julienfastre commented on Nov 3, 2017

    @julienfastre

    I encounter the same issue and was coming here to fill a ticket...

    This is the output of var_dump of an object coming with listObjects:

    OpenStack\ObjectStore\v1\Models\Object {#6829
      +containerName: null
      +name: "pthcomk44oKcDvKAguRv6I"
      +hash: "690cb08dbdafca1829f8f47accb275fb"
      +contentType: null
      +contentLength: 3979981
      +lastModified: null
      +metadata: null
      +"markerKey": "name"
      +"aliases": array:1 [
        "bytes" => "contentLength"
      ]
      +"resourcesKey": null
      +"resourceKey": null
    }
    

    $containerName is null, as you can see.

  2. julienfastre commented on Nov 3, 2017

    @julienfastre

    I spent a couple of minutes inspecting the code to suggest a PR, but I am blocked here on OperatorResource, line 90 the $data array does not contains the containerName.

    I suppose that this $data array come from the answer of swift api, but how can I ask the OpenStack\Common\Resource\Iterator object to add container name to this array ?

    If you can guide me, I would be happy to help.

  3. haphan commented on Feb 8, 2018

    @haphan
    Collaborator

    Confirm this is a bug and I was able to reproduce on my end.

    This issue is being addressed at #208.

    @julienfastre @thatipelli69

  4. haphan commented on Feb 8, 2018

    @haphan
    Collaborator

    This issue was fixed and merged to branch 3.x and backported to 2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions