Page MenuHomeMiraheze

Cargo Tables with Same Name on Different Wikis Are Conflicting
Closed, ResolvedPublic

Description

Description of Issue
When a new Cargo table is created, if it shares the same name as a Cargo table on a different Wiki, the older existing table will break.

For background, I had two Cargo tables called "Skills" on the Brown Dust Wiki and Another Eden Wiki. I received reports from users that the Another Eden Wiki's Skills table was broken, complaining that it couldn't find some of the table column names (despite the template not being touched for 9 days). I rebuilt the table to fix the issue.

Some time after, I rebuilt the Skills table on the Brown Dust Wiki. I, again, received reports from users that the Another Eden's Skills table was broken again with the same error. Oddly enough, I noticed that the number of rows in the broken table was the same number of rows as the Brown Dust Wiki's Skill table, and after a little bit of testing, confirmed that somehow a new table with the same name will break the existing table.

Steps to Reproduce

Requirements:

  • Two different Wikis with the Cargo extension enabled (eg. Brown Dust Wiki, Another Eden Wiki)

Steps:

  1. On one of the Wikis, create a new template with Cargo declare/store to create a new Cargo table.
  2. Create the Cargo table.
  3. View the table from Special:CargoTables, or going directly to the view: /wiki/Special:CargoTables/<Name of Table>
  4. On the other Wiki, do the same steps. Can reuse the same template if desired.
  5. After creating the Cargo table on the second Wiki, verify the view of the table on the first Wiki now throws:
Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Additional Notes

  • Recreating the table again on the first Wiki allowed viewing both tables again correctly, although it doesn't appear storing data into the tables works correctly (either that or my test template was acting janky).
  • Recreating the table again from the second Wiki after that will cause the first table to throw an exception again.

Current Work Arounds

  • Rename one of the tables to something different. May be difficult to coordinate if two different Wikis with separate communities that don't interact encounter this issue though.
  • Recreate the older existing table again. May have side effects though, and will break again if other table is recreated again.

Event Timeline

John triaged this task as High priority.Mar 8 2019, 13:02
John added a project: Configuration.
John subscribed.

Caused by us reusing the same database.

Can someone change this please.

This is the problem, I didn't realize we set that manually. That needs to be like "cargo_" . $wgDBname" or even just $wgDBname, which I believe is the default. (But we may not want to use the default so it can be removed later if the extension is deleted?)

@NDKilla let's use the actual wiki database rather than creating yet another one.

@NDKilla let's use the actual wiki database rather than creating yet another one.

That's fine.

Kind of mentioned this in -staff on IRC instead of here (no real reason it should have been in staff). I had concerns about that but kind of realized it was all moot anyways. This should be changed to be $wgDBname but I'm not sure what to do about any possibly data that already exists inside cargodb.