teable icon indicating copy to clipboard operation
teable copied to clipboard

500 error when trying to filter a table by a linked field

Open eliko1991 opened this issue 6 months ago • 2 comments

Describe the bug I have a table that contains a link to another table. When attempting to filter by the linked field, I am getting a 500 error on my self hosted community edition.

To Reproduce Steps to reproduce the behavior:

  1. Go to a table that contains a linked field
  2. Click on 'Filter'
  3. Select the linked column
  4. Attempt to select a record or search for one in the textbox

Expected behavior I expected to be able to filter by values present in the linked table.

** Client (please complete the following information):**

  • Mac OS
  • Chrome
  • 138.0.7204.184 (Official Build) (arm64)

Platform (Please tell us which deployment version you are using) docker on a linux machine using latest teable image from ghcr.

Additional context Portion of the log: "message": "\nInvalid prisma.$queryRawUnsafe() invocation:\n\n\nRaw query failed. Code: 42702. Message: ERROR: column reference \"sample_id\" is ambiguous",

eliko1991 avatar Aug 06 '25 14:08 eliko1991

Some additional details. The error above I got on tables that were imported from .tea files, where all the dependent tables were present. I was able to get around that issue but changing the type of the column to text, and reverting back to link.

On non imported table, you don't get the issue of the values not being displayed.

However, for both imported and non imported tables in linked fields, the text serach box doesn't work and produces a 500 error.

Would appreciate any help in getting more details about this. Am I the only one experiencing this or this is an actual bug?

eliko1991 avatar Aug 06 '25 15:08 eliko1991

Same issue for me , here is temporary solution

Workaround

A simple workaround is to remove the column name ambiguity in your base.

  1. Identify the two tables involved in the link.
  2. Inspect the field names in both tables and find the name that is duplicated (e.g., Label).
  3. Rename the field in one of the tables to make it unique (e.g., change Label to Project Name).

This resolves the ambiguity at the database schema level and allows the search to function correctly.

abdelali-hamza avatar Sep 09 '25 11:09 abdelali-hamza