I have a simple stream that reads a CSV from an en...
# ask-ai
l
I have a simple stream that reads a CSV from an endpoint I see the data however, when I try to select a primary key it errors: Path [] does not have field
ISPB
in the schema and hence can't be marked as required. version: 1.7.2
k
Based on the error message you're encountering, it appears that Airbyte cannot find the field
ISPB
in your stream's schema when you're trying to set it as a primary key. Here are the most likely causes and solutions: ## Possible Causes 1. Field not detected in schema: The field
ISPB
may not be present in the discovered schema from your CSV source. This could happen if: - The field name has different casing or spacing in the actual CSV - The schema discovery didn't properly detect this field - The field is nested and you need to specify the path correctly 2. Schema needs to be refreshed: If you recently added or modified the CSV structure, the schema may be outdated. ## Solutions ### 1. Verify the Field Exists First, check that the field is actually present in your stream's schema: - Navigate to your connection's Schema tab - Toggle the stream to display all its fields - Verify that
ISPB
appears in the list of detected fields ### 2. Refresh the Schema If the field should be there but isn't showing up, try refreshing the schema: - Go to the Schema tab of your connection - Look for a refresh option to re-discover the source schema - This will force Airbyte to re-read the CSV structure ### 3. Check Field Selection According to the [Configuring Schemas documentation](https://docs.airbyte.com/platform/1.7/using-airbyte/configuring-schema#select-fields), you cannot deselect a primary key field. Make sure the
ISPB
field is selected (toggled on) in your stream configuration. ### 4. Set the Primary Key Correctly When setting a primary key, as described in the [User-Defined Primary Key documentation](https://docs.airbyte.com/platform/1.7/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-primary-key): 1. Click on the toggle for your stream to show all its fields 2. Select the
ISPB
field from the fields displayed as the primary key 3. Save your changes If the field name has different casing in your CSV (e.g.,
ispb
,
Ispb
), make sure you're using the exact field name as it appears in the detected schema. If none of these solutions work, the issue might be with how your CSV connector is parsing the file. You may need to verify that the CSV is being read correctly and all columns are being detected during the schema discovery phase.
l
@kapa.ai I can see the field on the schema
k
A message from kapa.ai
Based on your confirmation that you can see the
ISPB
field in the schema, the error message "Path [] does not have field
ISPB
in the schema" suggests an issue with how the primary key is being specified or selected. ## Troubleshooting Steps ### 1. Verify Field Selection According to the [User-Defined Primary Key documentation](https://docs.airbyte.com/platform/1.7/using-airbyte/core-concepts/sync-modes/incremental-append-deduped#user-defined-primary-key), when setting a primary key: - Make sure the
ISPB
field is selected (toggled on) in your stream configuration - You cannot set a field as a primary key if it's deselected from the sync ### 2. Check the Primary Key Format The error mentions "Path []" which suggests the primary key path might be empty or incorrectly formatted. According to the [Primary Key documentation](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/PrimaryKey), a primary key can be: - A single field:
id
- An array of fields for composite keys:
["code", "type"]
Make sure you're selecting the primary key through the UI properly, not manually entering it. ### 3. Try These Steps 1. Deselect and reselect: Try removing the primary key selection, saving, then selecting
ISPB
again as the primary key 2. Refresh the page: Sometimes the UI state can get out of sync - try refreshing your browser 3. Check sync mode: Ensure you're using a sync mode that supports primary keys (like [Incremental Sync - Append + Deduped](https://docs.airbyte.com/platform/1.7/using-airbyte/core-concepts/sync-modes/incremental-append-deduped)) ### 4. Verify the Field is Not Nested If
ISPB
is a nested field within your CSV structure, you may need to specify the full path to the field. However, for a simple CSV, fields should typically be at the root level. If the issue persists after trying these steps, there may be a bug in version 1.7.2 with how the CSV connector handles primary key selection. You might want to check if there are any known issues or consider updating to a newer version if available.