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

Cannot select saved questions from collections that have colon in their name in the query builder #14287

Closed
mlazowik opened this issue Jan 6, 2021 · 1 comment · Fixed by #16904
Assignees
Labels
Organization/Collections Organization/Saved Questions Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Milestone

Comments

@mlazowik
Copy link

mlazowik commented Jan 6, 2021

Describe the bug
The table picker says "No tables found in this database." for every collection that has a colon in its name. The reason is that the frontend sends malformed API requests (cuts the collection name right before the colon), and so it gets a 404 from the API.

Logs
Server:

[7876f9e5-776b-4a94-ba6b-469dc229e21e] 2021-01-06T20:53:31+01:00 WARN metabase.middleware.log GET /api/database/-1337/schema/ScanForm 404 1.1 ms (1 DB calls) 
"Not found."

Frontend:

[Error] Request entities,schemas,-1337:ScanForm: TK,fetch failed: – {status: 404, data: "Not found.", isCancelled: false}
	(anonymous function) (app-main.bundle.js:5:62011)
	l (vendor.bundle.js:98:125993)
	(anonymous function) (vendor.bundle.js:98:125778)
	r (app-main.bundle.js:5:57724)
	(anonymous function) (app-main.bundle.js:5:57844)
	promiseReactionJob

Note that the frontend thinks it's requesting schemas from ScanForm: TK, but the server log shows ScanForm only.

To Reproduce
Steps to reproduce the behavior:

  1. Create a collection with : in its name
  2. Create a question, save it in that collection
  3. Open query builder, select "Saved Questions" in the picker, then the collection you've created in step 1.

Expected behavior
Saved questions show up, just like for collections that don't have : in their name.

Screenshots
Screenshot 2021-01-06 at 20 57 55

Information about your Metabase Installation:

  • Your browser and the version: Safari Technology Preview Release 117 (Safari 14.1, WebKit 15611.1.7.2), Chrome 87.0.4280.88 (Official Build) (x86_64)
  • Your operating system: macOS 10.15.7 (19H114)
  • Your databases: PostgreSQL, sqlite3
  • Metabase version: v0.37.4
  • Metabase hosting environment: Docker
  • Metabase internal database: H2

Severity
Low-ish

Additional context
Manually making a request to /api/database/-1337/schema/ScanForm:%20TK instead of /api/database/-1337/schema/ScanForm succeeds.

@mlazowik mlazowik added .Needs Triage Type:Bug Product defects labels Jan 6, 2021
@mlazowik
Copy link
Author

mlazowik commented Jan 6, 2021

export const parseSchemaId = id => String(id || "").split(":");

throw new Error("Schemas ID is of the form dbId:schemaName");

@flamber flamber added Organization/Collections Priority:P2 Average run of the mill bug Querying/Nested Queries Questions based on other saved questions Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Organization/Saved Questions and removed .Needs Triage Priority:P2 Average run of the mill bug Querying/Nested Queries Questions based on other saved questions labels Jan 6, 2021
@nemanjaglumac nemanjaglumac added this to Backlog in Cypress Testing Jan 8, 2021
nemanjaglumac added a commit that referenced this issue Jan 8, 2021
nemanjaglumac added a commit that referenced this issue Jan 9, 2021
@nemanjaglumac nemanjaglumac added the .Reproduced Issues reproduced in test (usually Cypress) label Jan 9, 2021
@alxnddr alxnddr self-assigned this Jul 6, 2021
@flamber flamber added this to the 0.40 milestone Jul 8, 2021
This was referenced May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Organization/Collections Organization/Saved Questions Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
Development

Successfully merging a pull request may close this issue.

4 participants