PostHog / PostHog/posthog

Bug report: Surveys - errors during export attempts

Open
#47,780 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature/surveys feature/table-exports team/conversations
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Bug Description

Please describe.

When trying to export current columns to csv, with default filters applied, the export attempt fails with an exception (no supertype, for a list of types.)

Image Image
    "exception": "There is no supertype for types String, Float64, String, String, String, String, String, String because some of them are String/FixedString/Enum and some of them are not: While processing (uuid, event, properties, toTimeZone(timestamp, 'US/Central'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'US/Central'), person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'US/Central'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'US/Central'), person_mode)`, arrayStringConcat(if(JSONHas(properties, '$survey_response_5443f36f-6ae8-4f4e-b347-b5a216ef0c22') AND (length(JSONExtractArrayRaw(properties, '$survey_response_5443f36f-6ae8-4f4e-b347-b5a216ef0c22')) > 0), JSONExtractArrayRaw(properties, '$survey_response_5443f36f-6ae8-4f4e-b347-b5a216ef0c22'), JSONExtractArrayRaw(properties, '$survey_response')), ', ') AS `arrayStringConcat(if(and(JSONHas(events.properties, '$survey_response_5443f36f-6ae8-4f4e-b347-b5a216ef0c22'), greater(length(JSONExtractArrayRaw(events.properties, '$survey_response_5443f36f-6ae8-4f4e-b347-b5a216ef0c22')), 0)), JSONExtractArrayRaw(events.properties, '$survey_response_5443f36f-6ae8-4f4e-b347-b5a216ef0c22'), JSONExtractArrayRaw(events.properties, '$survey_response')), ', ')`, arrayStringConcat(if(JSONHas(properties, '$survey_response_a2997aa2-046e-47f9-a334-7b489e5a2fe3') AND (length(JSONExtractArrayRaw(properties, '$survey_response_a2997aa2-046e-47f9-a334-7b489e5a2fe3')) > 0), JSONExtractArrayRaw(properties, '$survey_response_a2997aa2-046e-47f9-a334-7b489e5a2fe3'), JSONExtractArrayRaw(properties, '$survey_response_1')), ', ') AS `arrayStringConcat(if(and(JSONHas(events.properties, '$survey_response_a2997aa2-046e-47f9-a334-7b489e5a2fe3'), greater(length(JSONExtractArrayRaw(events.properties, '$survey_response_a2997aa2-046e-47f9-a334-7b489e5a2fe3')), 0)), JSONExtractArrayRaw(events.properties, '$survey_response_a2997aa2-046e-47f9-a334-7b489e5a2fe3'), JSONExtractArrayRaw(events.properties, '$survey_response_1')), ', ')`, toTimeZone(timestamp, 'US/Central') AS timestamp, coalesce(if(has(person_properties_map_custom, 'name'), person_properties_map_custom['name'], NULL), accurateCastOrNull(if(has(person_properties_map_custom, 'Name'), person_properties_map_custom['Name'], NULL), 'Float64'), nullIf(nullIf(mat_pp_email, ''), 'null'), if(has(person_properties_map_custom, 'Email'), person_properties_map_custom['Email'], NULL), nullIf(nullIf(mat_pp_username, ''), 'null'), if(has(person_properties_map_custom, 'Username'), person_properties_map_custom['Username'], NULL), if(has(person_properties_map_custom, 'UserName'), person_properties_map_custom['UserName'], NULL), distinct_id) AS `coalesce(person.properties.name, toFloat(person.properties.Name), person.properties.email, person.properties.Email, person.properties.username, person.properties.Username, person.properties.UserName, distinct_id)`, coalesce(JSONExtractString(properties, '$lib_version')) AS `coalesce(JSONExtractString(properties, '$lib_version'))`, coalesce(JSONExtractString(properties, '$lib')) AS `coalesce(JSONExtractString(properties, '$lib'))`, coalesce(JSONExtractString(properties, '$current_url')) AS `coalesce(JSONExtractString(properties, '$current_url'))`."

How to reproduce

  1. View this survey
  2. Scroll down to Export button and click it.
  3. Choose Export all columns, then CSV
  4. Wait a bit, then see the error.

Additional context

From: https://posthoghelp.zendesk.com/agent/tickets/50407 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/52237)

Debug info
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/019c5353-9be1-7ae3-97b3-b36f5c8f2201?t=801
Admin: http://go/adminOrgUS/0185bcba-5bd2-0000-c8df-885044c9c884 (project ID 19840)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure from the linked survey: choose Export all columns and CSV with the default filters. Trace the survey export flow and the generated query associated with the reported exception; done means the export completes successfully and produces a CSV.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
analytics, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.