Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25872] iOS: Log-server-port Build Error Masks Real Error

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDone
Resolution Date2018-08-01T16:16:22.000+0000
Affected Version/sRelease 7.1.0, Release 7.0.2
Fix Version/sn/a
ComponentsiOS
Labelscb-tooling, ios
ReporterEmily Feder
AssigneeChris Barber
Created2018-02-22T15:49:05.000+0000
Updated2018-08-01T22:17:55.000+0000

Description

*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.

Comments

  1. Mostafizur Rahman 2018-02-25

    Hello [~emilyafeder@gmail.com], Thanks for sharing with us. Please provide a full sample test code that regenerates the issue. Better to provide a sample app as an attachment here. We will test the issue in our environment. Thanks
  2. Mostafizur Rahman 2018-03-08

    Hello [~emilyafeder@gmail.com],
Just passing a followup here.Are you able to get that sorted out? Please let us know if you need more help with this issue. Regards
 Axway Appcelerator Support
  3. Chris Barber 2018-03-12

    The "Another process is currently bound to port..." error indicates that a Titanium app is currently running in an iOS Simulator. There are a couple ways in which a user can encounter this issue. The most common culprit is due to the iOS Simulator that ships with Xcode 9 which allows multiple simulators to run at the same time, so it's possible to build your Titanium app and run it in one simulator, then build it again and run it in a different simulator and that's when you run into the port conflict. You can simply close the other simulator or kill the app by double pressing the home button and swiping the app away. If you have 2 separate apps and run into this issue, then it's possible because the app id's are not unique or they just happen to hash to the same port number. Titanium will pick a port number based on the app id. This allows the Titanium app to be killed in the simulator and relaunched and the CLI should reconnect and display log messages.
  4. Sharif AbuDarda 2018-03-14

    Hello [~emilyafeder@gmail.com], Can you get back to us on Chris's comment?
  5. Emily Feder 2018-03-14

    Regarding the test app -- I'm still working on that. Regarding Chris Barber's comment, I do get that that is what the error is supposed to indicate. My point is that I got that error even though that wasn't the issue. I did not have multiple simulator/apps running at the same time and spent a lot of time fishing for the process that was using that port (even though there wasn't one). I had to dig into the sdk code and log out the actual error, which turned out to be that it did not recognize localhost as a legitimate host, because it had accidentally been removed from my /etc/hosts file. The ticket request is to have the error at least log out the error generated by net.createServer(). Currently it just assumes that there's an error because you have another process such as another simulator using that port already.
  6. Chris Barber 2018-03-15

    [~emilyafeder@gmail.com] Ah, that makes sense. Thought that "localhost" may not be correct never crossed my mind. I'd be happy to fix the verbiage.
  7. Emily Feder 2018-03-15

    Thanks!

JSON Source