500 Error when creating a template

Created on 23 August 2023, over 1 year ago
Updated 11 September 2023, over 1 year ago

Problem/Motivation

When attempting to create a template at admin/config/services/gathercontent/create-template, I receive a 500 error from the gathercontent server.

Steps to reproduce

  1. Install version 6.1.0 of this module.
  2. Configure authentication so that it connects to a gathercontent project. The project should have Items (content) and Templates (structure) applied to those items.
  3. Go to admin/config/services/gathercontent/create-template and select a value for each of the three fields.
  4. Press "Create".

The error message is:
GuzzleHttp\Exception\ServerException: Server error: `POST https://api.gathercontent.com/projects/123456/templates` resulted in a `500 Internal Server Error` response: { "error": "unknown error", "code": 500 } in GuzzleHttp\Exception\RequestException::create() (line 113 of /var/www/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).

Farther up the call stack is this:

GuzzleHttp\Client->request('POST', 'https://api.gathercontent.com/projects/123456/templates', Array) (Line: 895)
GatherContent\GatherContentClient->sendRequest('POST', 'projects/123456/templates', Array) (Line: 860)
GatherContent\GatherContentClient->sendPost('projects/123456/templates', Array) (Line: 554)
GatherContent\GatherContentClient->templatePost('123456', 'Article', Object) (Line: 240)
Drupal\gathercontent_upload\Export\MappingCreator->generateMapping('node', 'article', '123456') (Line: 138)

Proposed resolution

Find cause of the issue and fix it.

Remaining tasks

Find cause of the issue and fix it.

User interface changes

none

API changes

unknown

Data model changes

unknown

πŸ› Bug report
Status

Fixed

Version

6.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nadavoid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nadavoid
  • πŸ‡ΊπŸ‡ΈUnited States nadavoid
  • πŸ‡ΊπŸ‡ΈUnited States nadavoid

    With the error starting from the generateMapping() function, I'm looking at it and trying to understand what it does. It looks like it's trying to create a template at gathercontent, using a POST at https://api.gathercontent.com/projects/123456/templates. Is that correct and expected? I would expect that it would only read data from gathercontent and create mappings in Drupal, but I'm just learning how this integration and service works.

    I am also chatting with support at gathercontent to find out if there is something on their end that can resolve this.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States nadavoid

    I hadn't enabled the essential module, gathercontent_ui, and so was mistakenly using gathercontent_upload_ui. Using the regular mapping UI, I am able to create mapping and then import content after that.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024