autopkg / hansen-m-recipes

My recipes for Autopkg - https://github.com/autopkg
27 stars 49 forks source link

BESRelevanceProvider: QnA Error #45

Closed blinvisible closed 6 years ago

blinvisible commented 8 years ago

All recipes I'm trying that utilize the BESRelevanceProvider shared processor are producing this error during autopkg runs:

com.github.hansen-m.SharedProcessors/BESRelevanceProvider
BESRelevanceProvider: QnA Error: (/usr/local/bin/QnA) -- list index out of range
BESRelevanceProvider: version = None

I've tested with Firefox-Win.download, GoogleChrome-Win.download, and AdobeFlashPlayerActiveX-Win.download. Launching QnA on its own kicks out this error:

$ /usr/local/bin/QnA
libc++abi.dylib: terminating with uncaught exception of type MacintoshPlatform::CannotCreateSpecialFolder: 
Abort trap: 6

Any advice?

hansen-m commented 8 years ago

Are you using the GUI app AutoPkgr by chance?

QnA has some difficulty with relative paths depending on how it is launched. Do you have these three files in /usr/local/bin:

QnA libBEScrypto.dylib libBEScryptoFIPS.dylib

Did you install QnA with autopkg install QnA?

If you cd into /usr/local/bin and run ./QnA do you get the same error?

blinvisible commented 8 years ago

Are you using the GUI app AutoPkgr by chance?

No AutoPkgr, this is on the command line.

Did you install QnA with autopkg install QnA?

Yes, that is how QnA was installed.

Do you have these three files in /usr/local/bin

Yes, I have those three files in /usr/local/bin; interestingly, the two dylib files were readable only by root (700). I tried adding read (744) and execute (755) permissions but that did not change the error.

If you cd into /usr/local/bin and run ./QnA do you get the same error?

Yes, same error. If I run sudo ./QnA I see this error instead:

BESClientActionMastheadPath not set and no masthead found

...though I'm assuming I wouldn't normally need to run the Windows-based autopkg recipes as root anyway.

hansen-m commented 8 years ago

That is interesting. This is what I have after re-installing with autopkg install QnA...

-rwxr-xr-x  1 root  wheel   6.9M Jun 10 16:06 /usr/local/bin/QnA
-rw-r--r--  1 root  wheel   1.8M Jun 10 16:06 /usr/local/bin/libBEScrypto.dylib
-rw-r--r--  1 root  wheel   1.8M Jun 10 16:06 /usr/local/bin/libBEScryptoFIPS.dylib

Although that last "error" sounds right, you should get that warning followed by a "Q:" prompt.

blinvisible commented 8 years ago

Although that last "error" sounds right, you should get that warning followed by a "Q:" prompt.

Yes, I did get the Q: prompt.

This is what I have after re-installing with autopkg install QnA...

I re-ran autopkg install QnA and it reset the permissions back to:

-rwxr-xr-x   1 root      wheel   6.9M Jun 10 16:18 QnA
-rwx------   1 root      wheel   1.8M Jun 10 16:18 libBEScrypto.dylib
-rwx------   1 root      wheel   1.8M Jun 10 16:18 libBEScryptoFIPS.dylib

New information: the machine I'm testing on currently runs 10.9 server. I ran another test on my 10.11 client, and QnA installed with the "correct" permissions that you have, AND BESRelevanceProvider manages to get the version number fine, so it appears to be a problem with QnA running on OS X 10.9.5. Is QnA-9.5.2.56.pkg not compatible with Mavericks? Is there a previous version that would be? I don't see myself updating the server OS for probably another year or so.

hansen-m commented 8 years ago

I'm actually using a very similar setup and it is working on my 10.11 client and my 10.9.5 autopkg server with QnA version 9.5.2.56. Everything is working (although there may be a different issue with the GoogleChrome-Win recipe).

The permissions on the .dylib files still seem very suspect to me, I don't think autopkg processor is ever going to work unless you can call QnA without sudo. You said you tried changing the permissions on the .dylib files to 644 with the same result? Any other special permissions? Maybe try copying over the three files from your 10.11 install?

blinvisible commented 8 years ago

I copied the three files from my 10.11 client to my 10.9 server, adjusted permissions to match what you had listed, even rebooted for good measure, but still getting the "list index out of range" error. BESRelevanceProvider seems to be able to get the sha sums fine, QnA is just not able to get the version number. Here's the full run feedback:

$ autopkg run -v Firefox-Win.download
Processing Firefox-Win.download...
URLDownloader
URLDownloader: Item at URL is unchanged.
URLDownloader: Using existing /Users/Shared/autopkg-share/Cache/com.github.hansen-m.download.Firefox-Win/downloads/Firefox.exe
com.github.hansen-m.SharedProcessors/WinInstallerExtractor
WinInstallerExtractor: Extracting: /Users/Shared/autopkg-share/Cache/com.github.hansen-m.download.Firefox-Win/downloads/Firefox.exe
WinInstallerExtractor: Extracted Archive Path: /Users/Shared/autopkg-share/Cache/com.github.hansen-m.download.Firefox-Win/ExeExtract
com.github.hansen-m.SharedProcessors/BESRelevanceProvider
BESRelevanceProvider: bes_sha1 = 0124a42ad37ec96b658692a1648f23fe9c1a16d4, bes_size = 45032224, bes_sha256 = 5f23623c6983dd14eca78f5549ea9d5946fed76d5c98281670c9bfa0b9e78532, bes_sha1_short = a16d4
BESRelevanceProvider: QnA Error: (/usr/local/bin/QnA) -- list index out of range
BESRelevanceProvider: version = None
PathDeleter
PathDeleter: Deleted /Users/Shared/autopkg-share/Cache/com.github.hansen-m.download.Firefox-Win/ExeExtract
EndOfCheckPhase
Receipt written to /Users/Shared/autopkg-share/Cache/com.github.hansen-m.download.Firefox-Win/receipts/Firefox-Win-receipt-20160613-093347.plist

The only other variable at play I can think of is that the autopkg repo /Users/Shared/autopkg-share is a mount_smbfs mount point to a Windows network share //sysimg2/staging$/autopkg. Is /usr/local/bin/QnA looking for something via a relative path that it's not finding? Does it require the file to be on a HFS+ formatted disk? I guess I'll try it with a local autopkg repo and see if that makes any difference.

blinvisible commented 8 years ago

I guess I'll try it with a local autopkg repo and see if that makes any difference.

Sadly, it did not, but I think I figured out what the issue is. Up to this point I've been running autopkg while ssh'd into the server using LDAP credentials. After running su -l [local admin] and then running autopkg again, QnA is able to get the version information just fine.

The LDAP credentials I'm using are part of an LDAP group, which is nested within the local admin group, so all LDAP accounts in that group have local admin privileges (can sudo, etc.). It appears as though that isn't enough for QnA to operate properly -- at least, not without some group permission modification, though I'm not yet sure what those should be. The group that gets assigned to these LDAP accounts by default is _lpoperator.

hansen-m commented 8 years ago

That's really interesting but not surprising. QnA definitely has a few quirks. I'll try to report this to the team at IBM.

We have a similar LDAP setup (although not on the autopkg server) and I just tested something similar with QnA and it seemed to work. These are my groups...

gid=5000 groups=5000,12(everyone),62(netaccounts),399(com.apple.access_ssh),204(_developer)

Still sounds like it might be some kind of odd permission or user account issue at work here.

cc: @jgstew (might have more input)

blinvisible commented 8 years ago

Comparing the group memberships between the local admin account and the LDAP account (filtering out ones they already have in common and LDAP-only groups) I have:

$ diff -y --suppress-common-lines <(groups [local admin acct] | tr ' ' '\n' | sort) <(groups [ldap acct] | tr ' ' '\n' | sort)
_appserveradm                   <
_appserverusr                   <
                                >   _postgres
                                >   _warmd
                                >   acctsupt
com.apple.access_addressbook    <
com.apple.access_afp            <
com.apple.access_backup         <
com.apple.access_calendar       <
com.apple.access_chat           <
com.apple.access_ftp            <
com.apple.access_mail           <
com.apple.access_smb            |   com.apple.access_ssh
com.apple.access_vpn            |   com.apple.loginwindow.netaccounts
localaccounts                   |   netaccounts

Can't say I see anything that leaps out at me, unless it's as simple as localaccounts vs. netaccounts. For completeness, here's the groups they already have in common:

$ comm -1 -2 <(groups [local admin acct] | tr ' ' '\n' | sort) <(groups [ldap acct] | tr ' ' '\n' | sort)
_appstore
_developer
_lpadmin
_lpoperator
admin
com.apple.access_loginwindow
com.apple.access_screensharing
com.apple.sharepoint.group.1
com.apple.sharepoint.group.10
com.apple.sharepoint.group.11
com.apple.sharepoint.group.12
com.apple.sharepoint.group.13
com.apple.sharepoint.group.14
com.apple.sharepoint.group.15
com.apple.sharepoint.group.16
com.apple.sharepoint.group.17
com.apple.sharepoint.group.18
com.apple.sharepoint.group.2
com.apple.sharepoint.group.3
com.apple.sharepoint.group.4
com.apple.sharepoint.group.5
com.apple.sharepoint.group.6
com.apple.sharepoint.group.7
com.apple.sharepoint.group.8
com.apple.sharepoint.group.9
everyone
staff
blinvisible commented 8 years ago

Checking system.log reveals a QnA crash report. Looks like the cause is the same "special folder" error I saw when running /usr/local/bin/QnA directly:

abort() called
terminating with uncaught exception of type MacintoshPlatform::CannotCreateSpecialFolder:

Is there a "special folder" that should exist somewhere that I can create? Here's the full crash report if you'd like to pass it along to your IBM contacts.

Process:         QnA [7536]
Path:            /usr/local/bin/QnA
Identifier:      QnA
Version:         ???
Code Type:       X86 (Native)
Parent Process:  Python [7515]
Responsible:     Terminal [7433]
User ID:         55095

Date/Time:       2016-06-13 15:58:21.064 -0400
OS Version:      Mac OS X 10.9.5 (13F1808)
Report Version:  11
Anonymous UUID:  D01632DA-17B9-64B8-FE30-745D2A8D281E

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called
terminating with uncaught exception of type MacintoshPlatform::CannotCreateSpecialFolder: 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x9c276952 __pthread_kill + 10
1   libsystem_pthread.dylib         0x96bfa167 pthread_kill + 101
2   libsystem_c.dylib               0x9b3e3284 abort + 155
3   libc++abi.dylib                 0x96d886c9 abort_message + 169
4   libc++abi.dylib                 0x96da947d default_terminate_handler() + 264
5   libc++abi.dylib                 0x96da6c30 std::__terminate(void (*)()) + 14
6   libc++abi.dylib                 0x96da664b __cxa_throw + 116
7   QnA                             0x000d4aee FindCreateCacheFolder(bool) + 749
8   QnA                             0x000c31c8 MacintoshPlatform::GetDefaultStorageLocation() + 64
9   QnA                             0x000c8827 QNAOptionsManager::StorageLocation() const + 47
10  QnA                             0x000c3d68 main + 893
11  QnA                             0x000bcd85 start + 53

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x9c277992 kevent64 + 10
1   libdispatch.dylib               0x9ad18899 _dispatch_mgr_invoke + 238
2   libdispatch.dylib               0x9ad18532 _dispatch_mgr_thread + 52

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00000000  ebx: 0xa17c4c0c  ecx: 0xbff4348c  edx: 0x9c276952
  edi: 0xa0ae71a8  esi: 0x00000006  ebp: 0xbff434a8  esp: 0xbff4348c
   ss: 0x00000023  efl: 0x00000206  eip: 0x9c276952   cs: 0x0000000b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000000   gs: 0x0000000f
  cr2: 0x9b3cf6e7

Logical CPU:     0
Error Code:      0x00080148
Trap Number:     132

Binary Images:
   0xbc000 -   0x564ffb +QnA (???) <0FAE6BFF-E970-3394-8D2F-39071F13416D> /usr/local/bin/QnA
0x8fe6a000 - 0x8fe9c497  dyld (239.5) <86B9ED65-6A74-340B-A990-2E21CAF0BB21> /usr/lib/dyld
0x9043d000 - 0x90518ff7  com.apple.LaunchServices (572.32 - 572.32) <AB10B8DB-73F9-3C83-A1C0-6882F18758A0> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x90543000 - 0x90548ff3  libsystem_platform.dylib (24.90.1) <0613F163-9A7A-3908-B30B-AC1627503933> /usr/lib/system/libsystem_platform.dylib
0x906b4000 - 0x906b5ffa  libsystem_sandbox.dylib (278.11.2) <8EEE43EA-9195-3FE2-8DAB-0489319632EC> /usr/lib/system/libsystem_sandbox.dylib
0x90abe000 - 0x90ad0fff  libsystem_asl.dylib (217.1.4) <51EB17C9-9F5B-39F3-B6CD-8EF238B05B89> /usr/lib/system/libsystem_asl.dylib
0x90b9f000 - 0x90bc7fff  libsystem_info.dylib (449.1.4) <6B96417A-08F3-3DB7-BC5B-8FCE051F3EF9> /usr/lib/system/libsystem_info.dylib
0x90c27000 - 0x90c2eff2  com.apple.NetFS (6.0 - 4.0) <915AA303-C02B-3B0C-8208-D8AAA4350DB4> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
0x9105a000 - 0x91065ffb  libcommonCrypto.dylib (60049) <F8E60C43-22EE-3E0B-9546-3365056901F1> /usr/lib/system/libcommonCrypto.dylib
0x91399000 - 0x9169affb  com.apple.CoreServices.CarbonCore (1077.17 - 1077.17) <02C72D54-E3D3-32B0-A081-E85A7038489D> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x917aa000 - 0x919524af  libobjc.A.dylib (551.1) <31CBE178-E972-30D1-ADC6-4B8345CAE326> /usr/lib/libobjc.A.dylib
0x91953000 - 0x91953ffd  libOpenScriptingUtil.dylib (157.1) <36B742B2-2DD3-305B-BEFB-092903F6D6F8> /usr/lib/libOpenScriptingUtil.dylib
0x91954000 - 0x91971ffb  libresolv.9.dylib (54) <3EC12A7F-6BA1-3976-9F1F-6A4B76303028> /usr/lib/libresolv.9.dylib
0x91cac000 - 0x91cbaff7  libz.1.dylib (53) <858B4D9F-D87E-3D81-B07A-DF9632BD185F> /usr/lib/libz.1.dylib
0x92064000 - 0x92068ff7  libmacho.dylib (845) <D8E93E59-1F80-3413-B9CF-78B848F6E873> /usr/lib/system/libmacho.dylib
0x935e4000 - 0x935ecfff  libcopyfile.dylib (103.92.1) <9B62DDFE-FEFD-31CA-989F-9BE0AB606C49> /usr/lib/system/libcopyfile.dylib
0x937ea000 - 0x937fcfff  libbsm.0.dylib (33) <1BE92DB5-0D2F-3BB5-BCC6-8A71EF2A3450> /usr/lib/libbsm.0.dylib
0x93865000 - 0x93b92ffe  com.apple.Foundation (6.9 - 1056.17) <6C2DBF85-90AB-3DCB-B56F-E2E3106085C2> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x93b93000 - 0x93ca5ffc  libsqlite3.dylib (158) <B3DB0FED-FE4C-314D-8329-CF7708C8AAF4> /usr/lib/libsqlite3.dylib
0x93dee000 - 0x93df2ffa  libcache.dylib (62) <9730D7F2-D226-3F30-8D26-BF598CB781F6> /usr/lib/system/libcache.dylib
0x94169000 - 0x94172fff  com.apple.DiskArbitration (2.6 - 2.6) <92F7575A-AA20-34D9-BB26-2CC8C3CCAFEB> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x9464f000 - 0x94650ffd  libunc.dylib (28) <22A126A1-DCFB-3BE5-A66B-C973F0A5D839> /usr/lib/system/libunc.dylib
0x946d6000 - 0x94701ff7  libsystem_network.dylib (241.4) <03BC404B-D0CB-3747-9CD5-B7A06A2ED0A9> /usr/lib/system/libsystem_network.dylib
0x94702000 - 0x94703fff  libSystem.B.dylib (1197.1.1) <E37820A8-ABFD-34C6-A7EF-1E335CBD8189> /usr/lib/libSystem.B.dylib
0x94c5f000 - 0x94cf7ff7  com.apple.Metadata (10.7.0 - 800.30) <CABD91D6-E03E-3963-8575-73C422A74DE9> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x94ea5000 - 0x94ea8ff9  com.apple.TCC (1.0 - 1) <A5FCF7AA-3F56-3A19-9DF1-661F1F02F79D> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
0x95cb2000 - 0x95d28ff3  com.apple.securityfoundation (6.0 - 55122.3) <AA722795-824A-34A2-AA4C-168F510C0408> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
0x95d92000 - 0x95d93fff  libDiagnosticMessagesClient.dylib (100) <B936B1D4-90BB-395D-8EA9-E1237608E7D0> /usr/lib/libDiagnosticMessagesClient.dylib
0x95e47000 - 0x95e78ffa  libsystem_m.dylib (3047.16) <28E614E8-7802-3E84-960A-AD4721EF10F7> /usr/lib/system/libsystem_m.dylib
0x95f3d000 - 0x95f55ff7  libsystem_malloc.dylib (23.10.1) <CB52555E-0F5B-31E3-A42A-FD4F930E2192> /usr/lib/system/libsystem_malloc.dylib
0x964c4000 - 0x964e8ff7  libxpc.dylib (300.90.2) <5ACBBE2C-74EB-3E88-BCBF-C573095318A5> /usr/lib/system/libxpc.dylib
0x964e9000 - 0x96513fff  libxslt.1.dylib (13.10) <7B086480-99FF-3DF7-8570-322FC783E1EA> /usr/lib/libxslt.1.dylib
0x96514000 - 0x96514fff  libkeymgr.dylib (28) <1B097DEA-011E-3B1C-86D5-6C7FAD5C765A> /usr/lib/system/libkeymgr.dylib
0x96790000 - 0x9679afff  com.apple.bsd.ServiceManagement (2.0 - 2.0) <B84F3916-236A-347B-9C1F-3DE571496737> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
0x96988000 - 0x9698dff6  libcompiler_rt.dylib (35) <9924DF2E-D80B-3A21-920D-544A4597203F> /usr/lib/system/libcompiler_rt.dylib
0x969fa000 - 0x969fcfff  libquarantine.dylib (71) <EE3B510E-1AEC-3171-8A1A-D6A5A42CF35C> /usr/lib/system/libquarantine.dylib
0x96beb000 - 0x96bf7ffc  libkxld.dylib (2422.115.15) <0BA50D94-06A5-3D4A-BBB6-5BA8DA6A2764> /usr/lib/system/libkxld.dylib
0x96bf8000 - 0x96bffffb  libsystem_pthread.dylib (53.1.4) <8B1B7B84-1B5D-32A8-AC0D-1E689E5C8A4C> /usr/lib/system/libsystem_pthread.dylib
0x96d87000 - 0x96dabff3  libc++abi.dylib (49.1) <43A04ACF-97A5-35ED-B454-6B5C0CF0F99D> /usr/lib/libc++abi.dylib
0x96dac000 - 0x96dafff7  libdyld.dylib (239.5) <D5E59E51-90EA-322F-9E43-3A23C11C489F> /usr/lib/system/libdyld.dylib
0x96e06000 - 0x9708cffa  com.apple.security (7.0 - 55471.14.40) <8F5ADF43-E2AB-3D31-86AA-296041496CCF> /System/Library/Frameworks/Security.framework/Versions/A/Security
0x9708d000 - 0x97093ffb  libunwind.dylib (35.3) <099D1A6F-A1F0-3D05-BF1C-0A7BB32D39C2> /usr/lib/system/libunwind.dylib
0x97094000 - 0x97095fff  libremovefile.dylib (33) <ED35EA79-EB06-3B84-A6D4-B1A9D6B8648D> /usr/lib/system/libremovefile.dylib
0x97096000 - 0x970a4fff  libxar.1.dylib (202) <B73748D4-F830-3C71-98B3-7A3ABF5136FD> /usr/lib/libxar.1.dylib
0x9738e000 - 0x973f7fff  com.apple.SystemConfiguration (1.13.1 - 1.13.1) <68986435-5B12-370A-9408-0282D176279F> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x98a79000 - 0x98ab6ff7  libauto.dylib (185.5) <CD008E66-4A0C-35F5-8D72-80D76A716A03> /usr/lib/libauto.dylib
0x98ca4000 - 0x98d17fff  com.apple.SearchKit (1.4.0 - 1.4.0) <6F607AB6-7553-37BA-BEC5-98FD7C27FAD7> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x98d54000 - 0x98d6cff7  com.apple.CFOpenDirectory (10.9 - 173.90.1) <3C19235C-4A49-34D4-B447-97D978F3D586> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
0x99063000 - 0x9907ffff  libCRFSuite.dylib (34) <FFF76EBA-DF35-3A5F-857F-3F4B1C9F4C77> /usr/lib/libCRFSuite.dylib
0x99098000 - 0x990c4ff7  com.apple.DictionaryServices (1.2 - 208) <33873336-BECD-3F62-A315-C45F24C1818C> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x99473000 - 0x994c8fff  libc++.1.dylib (120) <10C0A136-64F9-3CC2-9420-013247032120> /usr/lib/libc++.1.dylib
0x99f2a000 - 0x99f2effc  libpam.2.dylib (20) <50623D44-795F-3E28-AA85-23E0E7E2AE0E> /usr/lib/libpam.2.dylib
0x9a427000 - 0x9a428fff  libsystem_blocks.dylib (63) <2AC67D5E-ECD4-3644-A53C-9684F9B7AA33> /usr/lib/system/libsystem_blocks.dylib
0x9a429000 - 0x9a42bfff  libsystem_configuration.dylib (596.15) <E49AAD29-35C2-3EE2-AF4D-59514C4B478F> /usr/lib/system/libsystem_configuration.dylib
0x9a59b000 - 0x9a5a7ff7  com.apple.OpenDirectory (10.9 - 173.90.1) <DFE64B88-6851-3BD7-A484-70C7465E15F0> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
0x9a5a8000 - 0x9a5b0fff  liblaunch.dylib (842.92.1) <C180016C-F2DB-3D8B-A72D-5185CE67DFA2> /usr/lib/system/liblaunch.dylib
0x9a5b1000 - 0x9a601ff7  libcorecrypto.dylib (161.1) <135FD99E-2211-3DF4-825C-C9F816107F0C> /usr/lib/system/libcorecrypto.dylib
0x9a98d000 - 0x9ab8ffff  com.apple.CoreFoundation (6.9 - 855.17) <E382BBB6-4F41-3959-ADC7-238BE49A2155> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x9ad15000 - 0x9ad2dffd  libdispatch.dylib (339.92.1) <7E7A88BF-74B3-363B-B534-6F757DF2DDE3> /usr/lib/system/libdispatch.dylib
0x9ae66000 - 0x9aec4ffd  com.apple.AE (665.5 - 665.6) <FC42FC14-9DD0-366C-AD94-B05BE1E51BE3> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x9b20f000 - 0x9b217fff  libsystem_dnssd.dylib (522.92.3) <7B02C0E8-96AA-353F-9F39-5409D6A1326C> /usr/lib/system/libsystem_dnssd.dylib
0x9b218000 - 0x9b298ff7  com.apple.CoreServices.OSServices (600.4 - 600.4) <BEC1899D-50C2-3227-A805-307ECED06859> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x9b299000 - 0x9b385ff7  libxml2.2.dylib (26.8) <F65D8E1C-EB9E-305E-9C90-445C55210A73> /usr/lib/libxml2.2.dylib
0x9b386000 - 0x9b418ff9  libsystem_c.dylib (997.90.4) <A67AE2D6-404D-3335-9901-EC7D98497CD7> /usr/lib/system/libsystem_c.dylib
0x9b709000 - 0x9b75aff1  libstdc++.6.dylib (60) <354F284B-2343-3810-9CA2-E28038824F6E> /usr/lib/libstdc++.6.dylib
0x9b910000 - 0x9b979ffa  com.apple.datadetectorscore (5.0 - 354.5) <E065936D-CB2C-3662-A98B-DCA8E45D98F0> /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore
0x9b97a000 - 0x9b986ffc  libbz2.1.0.dylib (29) <3CEF1E92-BA42-3F8A-8E8D-9E1F7658E5C7> /usr/lib/libbz2.1.0.dylib
0x9b9c5000 - 0x9bb52ffb  com.apple.CFNetwork (673.6 - 673.6) <94E6A707-F707-339D-BCD9-D5F348D4A69B> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x9bb53000 - 0x9bb54fff  liblangid.dylib (117) <F18F76C6-7E4B-34AD-AE81-C1C031BF2F7D> /usr/lib/liblangid.dylib
0x9bdec000 - 0x9bdecfff  com.apple.CoreServices (59 - 59) <06747539-5035-3307-8645-9BC4E7F89023> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x9be3d000 - 0x9beb4ffb  com.apple.framework.IOKit (2.0.1 - 907.100.14) <EED051CC-1482-3426-9C1C-A3FFAF7E76F2> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x9beba000 - 0x9bec5ff6  com.apple.NetAuth (5.0 - 5.0) <3B2E9615-EE12-38FC-BDCF-09529FF9464B> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
0x9bedf000 - 0x9bee9ff7  com.apple.DirectoryService.Framework (10.9 - 173.90.1) <A0D07BF7-31DF-3575-A02F-BEB90006DC74> /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService
0x9beed000 - 0x9c0b3ffb  libicucore.A.dylib (511.36) <F58996B3-D255-3992-AAD9-3FA7F56A1860> /usr/lib/libicucore.A.dylib
0x9c17b000 - 0x9c184ff7  libsystem_notify.dylib (121.20.1) <4D3293AC-1CEF-347A-987F-2314AF3CC6EA> /usr/lib/system/libsystem_notify.dylib
0x9c25f000 - 0x9c27cff4  libsystem_kernel.dylib (2422.115.15) <41058711-749D-3BD3-A2F1-92B325BAFD61> /usr/lib/system/libsystem_kernel.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 6678
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=77.3M resident=13.2M(17%) swapped_out_or_unallocated=64.1M(83%)
Writable regions: Total=48.1M written=984K(2%) resident=1196K(2%) swapped_out=0K(0%) unallocated=46.9M(98%)

REGION TYPE                      VIRTUAL
===========                      =======
Kernel Alloc Once                     4K
MALLOC                             39.2M
MALLOC (admin)                       32K
Stack                              64.1M
VM_ALLOCATE                        1056K
VM_ALLOCATE (reserved)               12K        reserved VM address space (unallocated)
__DATA                             2208K
__LINKEDIT                         45.5M
__OBJC                              392K
__PAGEZERO                            4K
__TEXT                             31.8M
__UNICODE                           544K
mapped file                       189.0M
shared memory                         4K
===========                      =======
TOTAL                             373.8M
TOTAL, minus reserved VM space    373.7M
rustymyers commented 8 years ago

Do your LDAP configs specify a home folder? I assume they'd have to in order to allow logins. The crash seems to fail at a FindCreateCacheFolder(bool) method, which may relate to how your LDAP user has a home folder or the permissions underneath for caching folders. Perhaps it is missing some LDAP attribute that isn't mapped? Just a guess

blinvisible commented 8 years ago

Do your LDAP configs specify a home folder?

Yes, by default it's /users/[first letter of uid]/[second letter of uid]/[full uid], which I suppose could be a problem if QnA doesn't use $HOME but instead assumes /Users/$USER instead.

Perhaps it is missing some LDAP attribute that isn't mapped? Just a guess

And a good guess, but I'm not seeing any attributes that aren't mapped that seem to relate to directory paths. The unmapped ones are all University-specific. What is mapped is:

AppleMetaNodeLocation
AppleMetaRecordName
Department
GeneratedUID
NFSHomeDirectory
Password
PrimaryGroupID
RealName
RecordName
RecordType
UniqueID
UserShell

Hm, now that I look more closely, I see the LDAP-defined PrimaryGroupID is 100, which explains why all LDAP users are being assigned to group _lpoperator(100). I'll try testing an override with a static staff(20) and see if that makes any difference.

blinvisible commented 8 years ago

Changing the PrimaryGroupID didn't make any difference, but changing the NFSHomeDirectory mapping did.

**Test 1**
RecordName          = uid           # LDAP-defined uid, `foobar`
PrimaryGroupID      = gidNumber     # LDAP default is 100, which maps locally to `_lpoperator`
NFSHomeDirectory    = homeDirectory # LDAP default, `/users/f/o/foobar`
Result: QnA FAILURE

**Test 2**
RecordName          = uid           # LDAP-defined uid, `foobar`
PrimaryGroupID      = #20           # static override, map locally to `staff`
NFSHomeDirectory    = homeDirectory # LDAP default, `/users/f/o/foobar`
Result: QnA FAILURE

**Test 3**
RecordName          = uid           # LDAP-defined uid, `foobar`
PrimaryGroupID      = #20           # static override, map locally to `staff`
NFSHomeDirectory    = #/Users/$uid$ # static override, make homedir `/Users/foobar`
Result: QnA SUCCESS

**Test 4**
RecordName          = uid           # LDAP-defined uid, `foobar`
PrimaryGroupID      = gidNumber     # LDAP default is 100, which maps locally to `_lpoperator`
NFSHomeDirectory    = #/Users/$uid$ # static override, make homedir `/Users/foobar`
Result: QnA SUCCESS

**Test 5**
RecordName          = uid           # LDAP-defined uid, `foobar`
PrimaryGroupID      = gidNumber     # LDAP default is 100, which maps locally to `_lpoperator`
NFSHomeDirectory    = #/Users/tester    # static override, home directory `/Users/tester`
Result: QnA FAILURE

**Test 6**
RecordName          = uid           # LDAP-defined uid, `foobar`
PrimaryGroupID      = #20           # static override, map locally to `staff`
NFSHomeDirectory    = #/Users/tester    # static override, make homedir `/Users/tester`
Result: QnA FAILURE

So it is all about QnA expecting the home directory path to be/Users/$USER. Is there a better place to document that than in here?

This appears to be solved -- and never really was a hansen-m recipe/repo problem to begin with, so thanks to both of you for the help and sticking with me even when it wasn't your problem. If you're at PSU MacAdmins this year I'll buy you a $BEVERAGE of your choice.

"If knowledge can be shared, let it be." --Rusty Myers

jgstew commented 8 years ago

Sorry I'm late to the party.

What is interesting here is that this worked:

BESRelevanceProvider: bes_sha1 = 0124a42ad37ec96b658692a1648f23fe9c1a16d4, bes_size = 45032224, bes_sha256 = 5f23623c6983dd14eca78f5549ea9d5946fed76d5c98281670c9bfa0b9e78532, bes_sha1_short = a16d4

This tells me that QnA was always working, just not in the immediately following case:

BESRelevanceProvider: QnA Error: (/usr/local/bin/QnA) -- list index out of range
BESRelevanceProvider: version = None

This tells me that QnA did not have an issue reading the stats of the original download file, but it did have trouble when trying to get the VersionInfo out of the extracted contents of the original download file.

This suggests that the problem actually occurred here:

WinInstallerExtractor: Extracting: /Users/Shared/autopkg-share/Cache/com.github.hansen-m.download.Firefox-Win/downloads/Firefox.exe

I would guess that this step fails silently, and then when QnA attempts to get the version info from a file that doesn't exist, it fails. I'd guess this is due to permissions and folder issues like discovered above. I wonder if the code could failover to using /tmp in a case like this.

I definitely could be wrong about this, but when a step fails, I always suspect that step ( BESRelevanceProvider ) and the previous one ( WinInstallerExtractor )

This is definitely an unusual issue, but we are definitely the right group of people to debug odd issues with BESRelevanceProvider and WinInstallerExtractor

rustymyers commented 6 years ago

This issue appears to have been resolved. Closing now, but please reopen if I'm wrong.