I got this when editing the details of a project (rebased against HEAD this morning):
It looks like the changes were actually saved though, based on viewing the project details afterwards.
hach-que | |
May 16 2015, 3:31 AM |
F406208: pasted_file | |
May 16 2015, 3:31 AM |
I got this when editing the details of a project (rebased against HEAD this morning):
It looks like the changes were actually saved though, based on viewing the project details afterwards.
rP Phabricator | |||
rP1f6b53be0e0d Populate mail keys for new projects | |||
rP72a896f772b7 Add missing mail keys to Projects |
I'll headed to bed right now but I'll probably fix this tomorrow morning and cowboy commit it before deploying, just a heads up for when that lands.
We should fix this permanently since this is something like the third time we've hit it and it's super dumb that this mistake is possible (you'll hit this pathway only if your email is configured in a certain way). Some possible approaches:
(1) is arguably the "right" way but might be really messy and require defining a whole pile of useless getMailKey() stubs. (2) is a little sketchier but maybe pretty defensible in this case.
After this fix still get an unhandled exception :
#1364: Field 'mailKey' doesn't have a default value Stack trace: phlog called at [/srv/phabricator/phabricator/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php:226] AphrontDefaultApplicationConfiguration::handleException called at [/srv/phabricator/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:230] AphrontApplicationConfiguration::processRequest called at [/srv/phabricator/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:140] AphrontApplicationConfiguration::runHTTPRequest called at [/srv/phabricator/phabricator/webroot/index.php:19]
Re
#1048: Column 'mailKey' cannot be null Stack trace: phlog called at [/srv/phabricator/phabricator/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php:226] AphrontDefaultApplicationConfiguration::handleException called at [/srv/phabricator/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:230] AphrontApplicationConfiguration::processRequest called at [/srv/phabricator/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:140] AphrontApplicationConfiguration::runHTTPRequest called at [/srv/phabricator/phabricator/webroot/index.php:19]
I can't actually figure out what configuration avoids this error -- metamta.public-replies on and off both try to call getMailKey() for me.
I wrote part of a diff to introduce "generators" instead of requiring save() overrides -- it's probably a small step forward, but feels heavy without other use cases. I'm not going to pursue it for now:
https://secure.phabricator.com/differential/diff/31120/
Particularly, it wouldn't really make this less error-prone (you can forget to provide a generator as easily as you can forget to provide a value in save()) and defaulting the generator onto any property called "mailKey" felt too magical to me.
I'm just going to shelve this for now and maybe dig it up the next time I'm touching mail or come up with some other use for default generators.
There's also no actual technical reason that objects legitimately need to have a mailKey at the PhabricatorMailReplyHandler level right now.
Looking through my test instance from when I was building the offending diff that broke projects saves, looks like I was able to re-name projects and add members / watchers without getting mail key errors. I haven't really done any configuration to mail on this test instance and it generally doesn't actually send mail. Anyway, I think I can just remember next time I add mail functionality, and otherwise thanks for fixing projects!
Yeah, on further thought I suspect the magical config is just metamta.reply-handler-domain not being set.