macos pkg: How to log bash errors - bash

I have a macos app with a pkg installer. The pkg has a postinstall.sh and a preinstall.sh.
On most machines it works fine but for certain customers I get reports that the script has failed.
I've asked the users to send me the installer logs but those don't contain the actual bash error only something like this:
Sep 14 15:04:16 Filestars-Mac-Mini installd[2540]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “Filestar.21.0.12.0.osx-x64.pkg”." UserInfo={NSFilePath=./preinstall, NSURL=file:///Users/filestar/repos/Filestar/Filestar.Installer/macOs/Output/Filestar.21.0.12.0.osx-x64.pkg#Filestar.pkg, PKInstallPackageIdentifier=com.Filestar.pkg.Filestar, NSLocalizedDescription=An error occurred while running scripts from the package “Filestar.21.0.12.0.osx-x64.pkg”.} {
NSFilePath = "./preinstall";
NSLocalizedDescription = "An error occurred while running scripts from the package \U201cFilestar.21.0.12.0.osx-x64.pkg\U201d.";
NSURL = "file:///Users/filestar/repos/Filestar/Filestar.Installer/macOs/Output/Filestar.21.0.12.0.osx-x64.pkg#Filestar.pkg";
PKInstallPackageIdentifier = "com.Filestar.pkg.Filestar";
}
How can I get the actual error?

During your preinstall.sh and postinstall.sh scripts, append to a log file. For example, you can rm -rf /var/tmp/Filestar.log during preinstall.sh then append anything you deem interesting there. Doing the same for postinstall.sh. Then if the user reports an issue have them send you the log file.

Related

yarn deploy give error with Command failed with exit code 1 when running collection-examples-as

I am trying to run the collection-examples-as near example but when I run yarn deploy it gives me the following error
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: ENOENT: no such file or directory, open './contract.wasm'
[Error: ENOENT: no such file or directory, open './contract.wasm'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './contract.wasm'
}
error Command failed with exit code 1.
I think the error is it can't find the path to ./contract.wasm so I run yarn build the I tried to deploy it again using yarn deploy but I got another error which is:
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: Can not sign transactions for account dev-1637744501224-6323200 on network
default, no matching key pair found in
InMemorySigner(MergeKeyStore(UnencryptedFileSystemKeyStore(/home/rasha/.near-
credentials), UnencryptedFileSystemKeyStore(/home/rasha/collection-examples-
as/neardev))).
{
type: 'KeyNotFound',
context: undefined
}
any help or suggestions?
There's an issue with old versions of near-cli and dev-deploy.
As a workaround, you can try running the latest cli directly from your terminal:
near dev-deploy --wasmFile="./contract.wasm" -f
Just check that you installed the latest version of near-cli, currently 2.2.0. You can check your version with near --version.
Be sure to run yarn build first, so you'll have the compiled contract.wasm file.
Note: When you run yarn deploy, it uses the old near-cli version defined in package.json. (probably some old version like 1.6.0)
You might also want to check this GitHub issue (dev-deploy error): https://github.com/near/create-near-app/issues/1408

Could not find out the solution for following error

We trying to build sencha on "ios" platform. But after performing command- sencha app build -run native, it gives following error.
Command Used: sencha app build -run native
The following error occurred while executing this line:
/Users/test/Desktop/UNHR_New 2/UNHR2/UNHR/UN Human Rights/UNHR/.sencha/app/build-impl.xml:436: The following error occurred while executing this line:
/Users/test/Desktop/UNHR_New 2/UNHR2/UNHR/UN Human Rights/UNHR/.sencha/app/packager-impl.xml:17: The following error occurred while executing this line:
/Users/test/Desktop/UNHR_New 2/UNHR2/UNHR/UN Human Rights/UNHR/.sencha/app/cordova-impl.xml:66: The following error occurred while executing this line:
jar:file:/Users/test/bin/Sencha/Cmd/6.2.1.29/sencha.jar!/com/sencha/ant>/antlib.xml:674: shellscript returned: 1
I think you should use the root account to execute the command.

Error: EACCES, unlink...

I'm trying to get my meteor app up and running, but I don't understand the error that its throwing at all, which is:
/Users/ten3/.meteor/packages/meteor- tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278
throw(ex);
^
Error: EACCES, unlink '/Users/ten3/Desktop/git/ten/website/prospect-recovery/prospect-recovery/.meteor/local/db/mongod.lock'
at Object.Future.wait (/Users/ten3/.meteor/packages/meteor-tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
at /tools/fs/files.js:1331:28
at Object.wrapper [as unlink] (/tools/fs/files.js:1334:20)
at findMongoAndKillItDead (/tools/runners/run-mongo.js:318:11)
at launchOneMongoAndWaitForReadyForInitiate (/tools/runners/run-mongo.js:400:7)
at launchMongo (/tools/runners/run-mongo.js:656:7)
at [object Object]._.extend._startOrRestart (/tools/runners/run-mongo.js:756:19)
at [object Object]._.extend.start (/tools/runners/run-mongo.js:714:10)
at /tools/runners/run-all.js:168:26
- - - - -
I'm running a shell script before I try to run a local copy of my meteor app. It supposed to stop my application from interacting with other APIs. When I run the script (I'm on a mac) through my terminal, it returns '0' which as I read means that there are zero errors. I know that the error message is guiding me to certain lines of code, but I don't understand why I would change them if my co-worker could get his copy up and running. He is running his application on a windows computer. Thank you. I'm pretty new to this.
It was a permission error just as #thatgibbyguy first suggested. I was able to run it buy using sudo meteor to override the permission restrictions. I wasn't about to remove my mongod.lock file since that my coworker had the file and was able to get it up and running.

Installing PlasticSCM on OS X Yosemite failing with 'abnormal error code: 129'

When executing PlasticSCM-5.4.16.628-osx-installer.app on OS X 10.10.1 (Yosemite), the password is requested and entered, nothing else appears on the screen.
Checking the console reveals Service exited with abnormal code: 129
The system has PlasticSCM version 5.0.44.581 - Manaos, originally installed under OS X 10.6.8 (Snow Leopard), prior to the Yosemite upgrade. Plastic Manaos is running as expected, under Yosemite after upgrading X11 to XQuartz 2.7.7.
The full log entries for the failed installer execution:
12/9/14 6:41:35.782 PM SecurityAgent[4423]: Failed to initialize IconCache named: com.apple.iconservices with error: Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." (connection to service named com.apple.iconservices) UserInfo=0x7ffcb3da95c0 {NSDebugDescription=connection to service named com.apple.iconservices}
12/9/14 6:41:35.783 PM SecurityAgent[4423]: Error returned from iconservicesagent: Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." (connection to service named com.apple.iconservices) UserInfo=0x7ffcb3dacc00 {NSDebugDescription=connection to service named com.apple.iconservices}
12/9/14 6:41:42.822 PM SecurityAgent[4423]: Error returned from iconservicesagent: Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." (connection to service named com.apple.iconservices) UserInfo=0x7ffcb3c99b50 {NSDebugDescription=connection to service named com.apple.iconservices}
12/9/14 6:41:43.043 PM authexec[4427]: executing /Users/glen/Downloads/PlasticSCM-5.4.16.628-osx-installer.app/Contents/MacOS/osx-intel
12/9/14 6:41:43.047 PM com.apple.xpc.launchd[1]: (com.bitrock.appinstaller.194004[4414]) Service exited with abnormal code: 129
I've googled a few phrases from the above, but still need a clue as to how to begin troubleshooting.
Any further ideas are much appreciated.
The problem is that the installer, osx-intel is not flagged as executable. Also sudo privileges are required.
From terminal, same directory as installer:
$ chmod +x ./PlasticSCM-5.4.16.633-osx-installer.app/Contents/MacOS/osx-intel
$ sudo ./PlasticSCM-5.4.16.633-osx-installer.app/Contents/MacOS/osx-intel
Success!

OS X NSTask error 22

I am building a simple package on OS X using pkgbuild that consists of a folder of stuff and the pre/postinstall scripts. When I try to execute the resulting package, the installer fails with the following message in the log:
Nov 1 13:28:11 localhost installd[631]: ./preinstall: 2013-11-01 13:28:11.074 installd[637:203] * NSTask: Task create for path '/tmp/PKInstallSandbox.P6mPx2/Scripts/com.xyz.utility.pkg.TWwYct/preinstall' failed: 22, "Invalid argument". Terminating temporary process.
The installer is running as root. The problem does not appear to be the contents of the scripts since they fail even after I cut them down to a simple "exit 0" with the interpreter declaration. This issues occurs on 10.8.2 and 10.8.4.
The issue looks like an exception that is thrown from within an NSTask object, but all I get is this 22 error code and the "Invalid argument" message. I think this message might refer to an NSInvalidArgumentException. I made sure the scripts are indeed being placed at the temporary location listed in the error message and they are there with the correct permissions.
Any ideas as to what causes this type of error message? I found several references to this error when I did some searching but there didn't seem to be a unifying cause or solution.
Add #!/bin/sh header into the preinstall script.

Resources