Opened 11 years ago

Closed 9 years ago

#43466 closed defect (fixed)

textmate2 @2.0-alpha.9537 configure error - "Unknown signee" while downloading TextMate Bundles

Reported by: david.hislop.1@… Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port: textmate2

Description

sudo port install textmate2 fails during configure with an error Unknown signee: 'org.textmate.msheets'.

The same error was reported in #42063 during discussion of a git fetch failure. I didn't see an obvious solution to the unknown signee error in that ticket, but maybe I missed it.

This is the excerpt from main.log:

:info:configure Downloading ‘https://api.textmate.org/bundles/default’…
:info:configure CSSM_ModuleLoad(): CSSMERR_DL_MDS_ERROR
:info:configure CSSM_ModuleLoad(): CSSMERR_DL_MDS_ERROR
:info:configure CSSM_ModuleLoad(): CSSMERR_DL_MDS_ERROR
:info:configure *** error importing key: No error.
:info:configure *** download_etag(‘https://api.textmate.org/bundles/default’): Unknown signee: ‘org.textmate.msheets’.
:info:configure *** error retrieving ‘https://api.textmate.org/bundles/default’ (no etag given)
:info:configure *** failed to update source: ‘TextMate Bundles’ (https://api.textmate.org/bundles/default)
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_editors_textmate2/textmate2/work/textmate-2.0-alpha.9537" && ./configure --prefix=/opt/local 
:info:configure Exit code: 1

I've tried:

sudo port clean textmate2
sudo port install textmate2

with the same result. I also tried:

sudo port uninstall --follow-dependents installed

and then re-installed all the previously-installed ports. textmate2 was the only one that failed.

I've attached the main.log.

Attachments (1)

main.log (209.1 KB) - added by david.hislop.1@… 11 years ago.

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by david.hislop.1@…

Attachment: main.log added

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to cal@…

comment:2 Changed 11 years ago by neverpanic (Clemens Lang)

I cannot reproduce that. You might want to ask upstream or do some debugging yourself, since I really have not idea what's wrong there. Trying again later might be an option as well.

comment:3 Changed 10 years ago by david.hislop.1@…

I fixed it and built TextMate successfully.

Had to first fix a bug that was preventing an error message displaying correctly and then I hazarded a guess at the likely solution.

In file key_chain.cc, the line if(err = SecItemImport(data, NULL, &type, &format, 0, &params, NULL, &items) == errSecSuccess) causes variable err to be set to the result of the logical expression, whereas the intent is to set it to the return value of SecItemImport. Needs either parentheses or splitting into an assignment and an if(). I chose the latter as in the diff output below.

Also, the documentation for SecItemImport shows that the sequence of parameters &type and &format is wrong. I reversed them.

These changes didn't fix the problem but at least showed that SecItemImport was returning errSecAddinLoadFailed. On a hunch, I changed both &type and &format to pass the "unknown" enum and that fixed the problem.

I've included below the diff of the resulting changes, with a long comment added explaining that I didn't investigate whether both &type and &format needed to be changed or just one. If I had to guess, I'd say it was &format.

I'll also pass this onto the TextMate list.

Thanks for your help. I have no idea how this was working for you and not me. Wild guess: maybe your TextMate keychain has entries in it that mine doesn't and the build I was doing attempted to add one that's broken.

*** /tmp/key_chain.cc	2014-06-12 15:55:45.000000000 +1000
--- /tmp/key_chain.cc_orig	2014-06-12 15:55:45.000000000 +1000
***************
*** 31,56 ****
  	bool res = false;
  
  	SecItemImportExportKeyParameters params = { .keyUsage = NULL, .keyAttributes = NULL };
! 	/*****************************************************
! 	/* Specifying the expected Item Type and Format
! 	 * caused SecItemImport to return 
! 	 * errSecAddinLoadFailed.
! 	 * I didn't check whether it was due to both being
! 	 * specified or just one. Setting to the Unknown enum
! 	 * worked.
! 	 * Original code on next two comment lines.
! 	/* SecExternalItemType type = kSecItemTypePublicKey;
! 	/* SecExternalFormat format = kSecFormatPEMSequence;
! 	 * Updated code with both vars set to unknown on next
! 	 * two lines. */
! 	SecExternalFormat format = kSecFormatUnknown;
! 	SecExternalItemType type = kSecItemTypeUnknown;
  
  	CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);
  	CFArrayRef items = NULL;
  	OSStatus err;
! 	err = SecItemImport(data, NULL, &format, &type, 0, &params, NULL, &items);
! 	if(err == errSecSuccess)
  	{
  		_sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);
  		if(_sec_key != NULL)
--- 31,43 ----
  	bool res = false;
  
  	SecItemImportExportKeyParameters params = { .keyUsage = NULL, .keyAttributes = NULL };
! 	SecExternalItemType type = kSecItemTypePublicKey;
! 	SecExternalFormat format = kSecFormatPEMSequence;
  
  	CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);
  	CFArrayRef items = NULL;
  	OSStatus err;
! 	if(err = SecItemImport(data, NULL, &type, &format, 0, &params, NULL, &items) == errSecSuccess)
  	{
  		_sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);
  		if(_sec_key != NULL)

comment:4 in reply to:  3 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to david.hislop.1@…:

In file key_chain.cc, the line if(err = SecItemImport(data, NULL, &type, &format, 0, &params, NULL, &items) == errSecSuccess) causes variable err to be set to the result of the logical expression, whereas the intent is to set it to the return value of SecItemImport. Needs either parentheses or splitting into an assignment and an if(). I chose the latter as in the diff output below.

Also, the documentation for SecItemImport shows that the sequence of parameters &type and &format is wrong. I reversed them.

Looks like the developer made these changes upstream: https://github.com/textmate/textmate/commit/6be2935518a2fd6c353886c4eedbefc76a92856b#diff-c1bf0f7671e17004d9138c38fcb4465f

These changes didn't fix the problem but at least showed that SecItemImport was returning errSecAddinLoadFailed. On a hunch, I changed both &type and &format to pass the "unknown" enum and that fixed the problem.

The developer has not made these changes. If you're still having problems installing the latest version of textmate2 in MacPorts, please let us and the developer of textmate2 know.

Note: See TracTickets for help on using tickets.