Page MenuHomePhabricator

Subversion requires password, or dies with “Expected PhutilOpaqueEnvelope for %P conversion”
Closed, ResolvedPublic


When a Subversion repository uses a credential with a username, but without a password, the repository is unable to get updated, as the update dies with “Error updating working copy: Expected PhutilOpaqueEnvelope for %P conversion.”

It seems to me that when PhabricatorRepository wants to get the password envelope from PassphrasePasswordKey::getPasswordEnvelope(), the latter returns null when there is no password (because the credential contains no SecretID). So, instead of a PhutilOpaqueEnvelope instance, PhabricatorRepository gets null and dies afterwards (trying to format this null with %P).

I fixed the problem locally by patching PassphrasePasswordKey::getPasswordEnvelope() to:

public function getPasswordEnvelope() {
  $result = $this->requireCredential()->getSecret();
  if (!$result) {
    $result = new PhutilOpaqueEnvelope('');
  return $result;

which seems to work correctly, but I have no idea whether this would be the correct fix, or this should be handled on a different place.

Event Timeline

mormegil raised the priority of this task from to Needs Triage.
mormegil updated the task description. (Show Details)
mormegil added a project: Diffusion.
mormegil added a subscriber: mormegil.

We should probably create the Secret, just leave the secret plaintext empty. We probably just didn't think about this case when writing the code, as it's a little unusual.

I believe D10414 will resolve this. After it lands, edit the credential, delete any bullets in the "password" field, and save it. Then "Reveal Secret" should show an explicit "empty" message, and it should work for authentication.

(I don't have a no-password HTTP SVN server handy to test with and it would probably take me longer to set one up than it did to fix the issue, so yell if I missed anything or things don't actually work after D10414 hits.)

Yep, I can confirm the fix seems to work correctly. Thanks.