EgorTarsenko opened a new issue, #35941:
URL: https://github.com/apache/superset/issues/35941
### Bug description
# Bug: `TAGGING_SYSTEM` Feature Flag Breaks Dashboard Creation in Superset
4.1.3
## Description
The `TAGGING_SYSTEM: True` feature flag causes dashboard creation to fail in
Superset 4.1.3 with a foreign key constraint violation.
## Steps to Reproduce
1. Enable the tagging system feature flag:
```python
"TAGGING_SYSTEM": True
```
2. Attempt to create a new dashboard via the UI
3. Error occurs immediately upon creation
## Expected Behavior
Dashboard should be created successfully with tagging system enabled.
## Actual Behavior
Dashboard creation fails with the following error:
```
sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked
autoflush; consider using a session.no_autoflush block if this flush is
occurring prematurely)
(psycopg2.errors.ForeignKeyViolation) insert or update on table
"tagged_object" violates foreign key constraint "tagged_object_object_id_fkey"
DETAIL: Key (object_id)=(72) is not present in table "slices".
[SQL: INSERT INTO tagged_object (created_on, changed_on, tag_id, object_id,
object_type, created_by_fk, changed_by_fk) VALUES (%(created_on)s,
%(changed_on)s, %(tag_id)s, %(object_id)s, %(object_type)s, %(created_by_fk)s,
%(changed_by_fk)s) RETURNING tagged_object.id]
[parameters: {'created_on': datetime.datetime(2025, 11, 2, 11, 8, 17,
190751), 'changed_on': datetime.datetime(2025, 11, 2, 11, 8, 17, 190754),
'tag_id': 73, 'object_id': 72, 'object_type': 'dashboard', 'created_by_fk': 2,
'changed_by_fk': 2}]
(Background on this error at: https://sqlalche.me/e/14/gkpj)
```
## Additional Context
- **Also affected:** Unable to attach tags to existing dashboards when this
feature is enabled
- **Root cause observation:** The error indicates a foreign key constraint
violation where `object_id=72` with `object_type='dashboard'` is being inserted
into `tagged_object` table, but the constraint expects this to reference the
`slices` table (which contains charts, not dashboards)
- **Possible cause:** Incorrect foreign key constraint configuration or
incorrect `object_type` handling in the tagging system
## Environment
- **Superset version:** 4.1.3
- **Database:** PostgreSQL (psycopg2)
- **Feature flag:** `TAGGING_SYSTEM: True`
## Severity
**High** - Blocks dashboard creation entirely when tagging system is enabled.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [ ] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]