appcelerator-titaniumappcelerator-mobile

Appcelerator Titanium build error about log-server-port masks the real error


This is relatively minor, and I wasn't able to find any other record of this issue, but it cost me several stressful hours. I'm considering opening an Appcelerator Jira ticket about this bug, so any feed back is welcome before I do so. Questions: Are there any other workarounds besides what I wrote below? What are some better ways to log the actual error?

Environment

Titanium SDK: 7.0.2.GA Javascript Engine: V8 Platform & version: iOS 11.2 Device Details: iOS simulator (iPhone 7+) Host Operating System: OS X 10.13 64 bit Node Version: 7.10.0 Titanium CLI: 5.0.14 Npm Version: 4.2.0

Description

When building an iOS app and there is an issue connecting to the iOS log-server, it always output "Another process is currently bound to port xxxxx" even if there is another server connection issue such as the port not existing.

Workaround

Figure out the real issue by logging the actual error within the sdk itself (at ~/Library/Application Support/Titanium/mobilesdk/osx/7.0.2.GA/iphone/cli/commands/_build.js in the determineLogServerPort function).

Steps to Reproduce

  1. Create a different type of error with the server. For example, my /etc/hosts file did not have an entry for 127.0.0.1 localhost, so the actual node error was 'ENOTFOUND'.
  2. Create a new titanium app with appc ti new.
  3. Build with appc ti build -p ios

Actual Result

Build errors out with following text:

[ERROR] Another process is currently bound to port 27973
[ERROR] Set a unique <log-server-port> between 1024 and 65535 in the <ios> section of the tiapp.xml

Expected Result

More detailed error. I.E. Something like:

Failed to create/connect to log server port with error "[error given by node net package]". Followed by suggested solution. For example if the node error was EADDRINUSE, then you could still use the existing error message. But if it's another error, log accordingly so the user has the best information for solving the issue.


Solution

  • I opened the ticket with appcelerator here: https://jira.appcelerator.org/browse/TIMOB-25872

    They have just marked it as closed so it will hopefully be included in the next sdk version.