Page MenuHomePhabricator

Setting `ui.custom-header` to an uploaded file then deleting that file breaks all of Phabricator
Closed, DuplicatePublic

Assigned To
None
Authored By
unitof
Jul 14 2015, 4:20 PM
Referenced Files
F623084: Screenshot 2015-07-13 18.40.43.png
Jul 14 2015, 4:20 PM
Subscribers
Tokens
"Pterodactyl" token, awarded by unitof.

Description

To reproduce (but not like that):

  1. Upload a file to use as a custom logo.
  2. Set ui.custom-header to that file's PHID.
  3. Delete the file uploaded in step 1.
  4. Wait about seven agonizing seconds.
  5. Load/refresh any Phabricator page.
  6. All Phabricator pages display Exception: PHID-FILE-abcd1234abcd1234abcd is not a valid file PHID.
    Screenshot 2015-07-13 18.40.43.png (1×1 px, 175 KB)

While I agree that invalid PHIDs are a crime, I think that revoking all access all Phabricator pages is probably a cruel and unusual punishment. One should probably be able to, for example, go back and correct the mistakes they have made.

Event Timeline

unitof raised the priority of this task from to Normal.
unitof updated the task description. (Show Details)
unitof added projects: Files, Config.
unitof added a subscriber: unitof.

Bonus sadness: I still cannot figure out how to set ui.custom-header via bin/config.

bin/config get ui.custom-header gives me

{
  "config": [
    {
      "key": "ui.custom-header",
      "source": "local",
      "value": null,
      "status": "unset",
      "errorInfo": null
    },
    {
      "key": "ui.custom-header",
      "source": "database",
      "value": "PHID-FILE-ufl7a74fomsmmlwasl6i",
      "status": "set",
      "errorInfo": null
    }
  ]
}

but bin/config set ui.custom-header PHID-FILE-abcd1234abcd1234abcd returns

Usage Exception: Config key "ui.custom-header" is of type "custom:PhabricatorCustomHeaderConfigType". Specify it in JSON.

I've even tried piping in a JSON file with the contents formatted exactly like the result of the bin/config get command but everything gives me that same error. I can't find anything on the syntax of a PhabricatorCustomHeaderConfigType.

In the end we wrote a fake entry into the phabricator_file table with a PHID of the now-missing file, and that allowed me back in to fix up all the bad config values.

Yeah, it's know this feature is experimental, possibly bad, and incomplete, which is why we warn people beforehand. T4214 is the "make it work as expected" task. Sorry for the troubles.

No worries! You're still my best friend. Just hope this report helps somehow. Thanks Chad.

FWIW I spent 20 minutes and couldn't set it from the command line either. But I am a JSON noob.

Same here, but I do see we are both design nerds. Wanna talk about skeuomorphism for a few hours?

I'm really glad that's still not a thing. :)