Page MenuHomePhabricator

Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string
Closed, ResolvedPublic

Description

We are changing the credentials that Phabricator uses to access our git repositories. I have added a new key and destroyed the old key. Is there a way to modify the repositories to use the new key or would I have to remove and re-add them?

Event Timeline

joshuaspence assigned this task to epriestley.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added projects: Auth, Repositories.
joshuaspence added a subscriber: joshuaspence.

Can you just update the existing key? e.g., if they're using K123, just replace the old private key with the new one.

I get this exception when trying to edit the existing key: Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string. I think its a permissions issue.

That just sounds like a bug. Is there a stack trace in the error log?

Our error logs aren't quite working at the moment. I'm in the process of moving Phabricator to a new dedicated host and don't really want to investigate where the logs are going until then.

Could i modify the DB directly?

The links from the repositories to credentials are in credentialPHID in phabricator_repository.repository, you can update that column to point at a new PHID, e.g.:

UPDATE phabricator_repository.repository SET credentialPHID = 'new-phid' WHERE credentialPHID = 'old-phid';
epriestley added a subscriber: epriestley.

Let me know if you dig up that stack trace, or still have issues here.

Here is the stack trace:

PHP message: [2014-05-26 22:07:13] EXCEPTION: (RuntimeException) Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string at [/usr/src/libphutil/src/error/PhutilErrorHandler.php:206]
PHP message:   #0 PhutilErrorHandler::handleError(4096, Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string, /usr/src/libphutil/src/internationalization/PhutilTranslator.php, 93, Array of size 6 starting with: { text => Credential has noncreateable type "%s"! })
PHP message:   #1 vsprintf(Credential has noncreateable type "%s"!, Array { 0 => Object PassphraseCredentialTypeSSHPrivateKeyFile }) called at [/usr/src/libphutil/src/internationalization/PhutilTranslator.php:93]
PHP message:   #2 PhutilTranslator::translate(Credential has noncreateable type "%s"!, Object PassphraseCredentialTypeSSHPrivateKeyFile)
PHP message:   #3 call_user_func_array(Array of size 2 starting with: { 0 => Object PhutilTranslator }, Array of size 2 starting with: { 0 => Credential has noncreateable type "%s"! }) called at [/usr/src/libphutil/src/internationalization/pht.php:19]
PHP message:   #4 pht(Credential has noncreateable type "%s"!, Object PassphraseCredentialTypeSSHPrivateKeyFile) called at [/usr/src/phabricator/src/applications/passphrase/controller/PassphraseCredentialEditController.php:37]
PHP message:   #5 PassphraseCredentialEditController::processRequest() called at [/usr/src/phabricator/webroot/index.php:95]" while reading response header from upstream, client: 10.204.122.108, server: phabricator.freelancer.com, request: "GET /passphrase/edit/1/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.socket:", host: "phabricator.freelancer.com"
joshuaspence renamed this task from Change credentials for a repository. to Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string..May 26 2014, 12:45 PM
joshuaspence renamed this task from Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string. to Object of class PassphraseCredentialTypeSSHPrivateKeyFile could not be converted to string.Jul 10 2014, 9:04 PM