Skip to content

BUGFIX: Handle PSR-7 ApiException responses#62

Open
erkenes wants to merge 1 commit intoFlowpack:masterfrom
erkenes:master
Open

BUGFIX: Handle PSR-7 ApiException responses#62
erkenes wants to merge 1 commit intoFlowpack:masterfrom
erkenes:master

Conversation

@erkenes
Copy link
Copy Markdown

@erkenes erkenes commented Apr 10, 2026

  • handle PSR-7 ResponseInterface responses
  • extract the response body when available (falling back to string cast)
  • log errors for both associative array and stdClass

- handle PSR-7 ResponseInterface responses
- extract the response body when available (falling back to string cast)
- log errors for both associative array and stdClass
@erkenes erkenes changed the title Handle PSR-7 ApiException responses BUGFIX: Handle PSR-7 ApiException responses Apr 10, 2026
@erkenes
Copy link
Copy Markdown
Author

erkenes commented Apr 10, 2026

This PR includes the bugfix from #54 and #55

json_decode(): Argument #1 ($json) must be of type string, GuzzleHttp\Psr7\Response given

but also fixes an issue with the logging

Warning: Attempt to read property "error" on array in /data/Data/Temporary/Development/SubContextDocker/SubContextCli/Cache/Code/Flow_Object_Classes/Flowpack_ElasticSearch_ContentRepositoryQueueIndexer_UpdateAliasJob.php line 143

@erkenes
Copy link
Copy Markdown
Author

erkenes commented Apr 13, 2026

I'm using OpenSearch, and this error can occur if, for example, the index permissions are not configured correctly.
I've corrected the permissions now, but the error should still be handled properly.

This is a working role configuration in OpenSearch:

foobar_neos:
  reserved: false
  hidden: false
  cluster_permissions:
    - "cluster_manage_index_templates"
    - "indices:data/write/bulk"
  index_permissions:
    - index_patterns:
        - "foobar_neos*"
        - "*_foobar_neos_*"
      dls: ""
      fls: []
      masked_fields: []
      allowed_actions:
        - "indices_all"
        - "indices:admin/delete" # required to delete old indices
    - index_patterns:
        - "*" # the allowed-actions are not working with the index-pattern above
      dls: ""
      fls: []
      masked_fields: []
      allowed_actions:
        - "indices:admin/aliases/get" # required to check if the alias is mapped to an index
        - "indices:monitor/stats" # required to fetch old indices and delete them
  tenant_permissions: []
  static: false

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant