Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Creating entities with certain date property values fails #3609

Open
tillprochaska opened this issue Feb 10, 2024 · 0 comments
Open

BUG: Creating entities with certain date property values fails #3609

tillprochaska opened this issue Feb 10, 2024 · 0 comments
Labels
backend Issues related to Aleph’s backend, API, CLI etc. bug Things that should work, but don’t

Comments

@tillprochaska
Copy link
Contributor

tillprochaska commented Feb 10, 2024

Describe the bug
Creating entities that have date properties in the format yyyy-MM-dd'T'HH:mm and yyyy-MM-dd HH:mm fails.

FollowTheMoney supports date properties in this format according to the documentation and Aleph also supports formats such as yyyy-MM-dd HH:mm:ss (datetime with seconds), yyyy-MM (year and month), and any other date and time precision, so it’s very unintuitive that these specific formats are not supported.

To Reproduce
Steps to reproduce the behavior:

This is just one way to trigger this bug, but really any way to create or update entity properties should have the same problem.

  1. Create an investigation.
  2. In the left-hand sidebar, select "Add new entity type" and "Event".
  3. In the table editor, create a new event entity and set the start date to 2024-01-01 00:00.
  4. Aleph will seemingly save the changes, but once you reload the page, the change will be gone.

Expected behavior
Aleph should successfully create and update entities in the formats mentioned above.

Aleph version
3.15.5

Additional context
This bug likely occurs due to a problem in the Elasticsearch field mappings for date properties. Date properties use the following custom format: yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd||yyyy-MM||yyyy. This custom format doesn’t match date-time values with minute precision.

Unfortunately, adding the missing date formats to the custom format in the mapping would require recreating the index (as Elasticsearch would consider the new mapping incompatible with the existing mapping).

See:

Elasticsearch error message when trying to update an existing mapping:

Index [aleph-entity-succession-v1] error: Mapper for [properties.startDate] conflicts with existing mapper:
Cannot update parameter [format] from [yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd||yyyy-MM||yyyy] to [yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd'T'HH:mm||yyyy-MM-dd||yyyy-MM||yyyy]

Elasticsearch error message when trying to index an entity with a (currently) unsupported date format:

Bulk index error: {'index': {'_index': 'aleph-entity-event-v1', '_type': '_doc', '_id': '...', 'status': 400, 'error': {'type': 'mapper_parsing_exception', 'reason': "failed to parse field [properties.startDate] of type [date] in document with id '...'. Preview of field's value: '2023-01-01T00:00'", 'caused_by': {'type': 'illegal_argument_exception', 'reason': "failed to parse date field [2023-01-01T00:00] with format [yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd||yyyy-MM||yyyy]", 'caused_by': {'type': 'date_time_parse_exception', 'reason': 'Failed to parse with all enclosed parsers'}}}}}

@tillprochaska tillprochaska added bug Things that should work, but don’t backend Issues related to Aleph’s backend, API, CLI etc. labels Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues related to Aleph’s backend, API, CLI etc. bug Things that should work, but don’t
Projects
None yet
Development

No branches or pull requests

1 participant