aiStarter Connection Issue

Problem Description: I am experiencing a sudden connection failure with the App Inventor Emulator in a computer lab environment (all PCs are equipped with recovery cards/deep freeze, so the system environment remains identical). It was working perfectly last week, but since this week, the emulator connection has stopped responding entirely.

When I click "Connect -> Emulator" on the App Inventor website, there is pop-up prompt from the browser, but aiStarter no action.

aiStarter Running Information:

Plaintext

App Inventor version: 30.265.0
Architecture: AMD64
ADB path: C:\Program Files\MIT App Inventor\from-Android-SDK\platform-tools\adb
Status: Listening on http://127.0.0.1:8004/

Manual Test Results:

  • Entering http://127.0.0.1:8004/ in the browser returns "Error: 405 Method Not Allowed". This confirms that the port is open and aiStarter is indeed listening and responding to local requests.

Troubleshooting Steps Taken:

  1. Environment Consistency: Since we use recovery cards, the system configuration is identical to last week's working state.

  2. Browser Testing: Both Google Chrome and Firefox fail to connect.

  3. Security Settings: In Chrome, I have already tried:

    • Allowing Local Network Access in Site Settings.
  4. Connection Logs: Despite clicking "Connect" on the website multiple times, the aiStarter console window shows no activity logs (no GET requests or incoming traffic). It seems the request is being blocked or dropped before reaching the local listener.

Any help would be greatly appreciated!

I recommend getting the Companion running on whatever emulator works for you, and using the Connect -> Companion sequence

See the FAQ for examples

Do you see any errors in the browser's console. Normally the first thing it does it try to reach http://127.0.0.1:8004/ping/ and you should see that appear in the aiStarter log. If it's not even getting that far, either something in the browser is blocking the connection, or it's a firewall issue, but as you've tested that last one is unlikely.

I don’t know if this is helpful, but this is from another thread with the same issue:

“Troubleshooting Steps Taken:

  1. If I manually type http://127.0.0.1:8004/start/ in the browser, the emulator launches perfectly. This confirms that aiStarter, adb.exe, and the emulator image are working correctly.

  2. I tested this on the main server, ai2-test, and the code server. The issue is identical across all of them.

  3. The issue persists even in Incognito/Private browsing mode.

The Error Log: When I open the Chrome Developer Tools (F12) and click the "Emulator" button, the request never leaves the browser. Instead, the Console is flooded with the following JavaScript crash:

Uncaught TypeError: Cannot read properties of undefined (reading 'XmlHttp') at O (aiblockly-4334f11839034257aba5b6bdd4c0e9e5fc18bb9b474b02760f65aac9eab4e453.cache.js:2051:123)

It appears that the frontend JavaScript is failing to instantiate the XMLHttpRequest object to communicate with localhost, causing the script to crash before sending the command to aiStarter.

Is there a known workaround for this specific JavaScript error, or is this a bug in the current Blockly web deployment? Any guidance would be greatly appreciated!

Thank you.”

Ok. I think I have an idea of what's going on based on that information and will investigate.

A proposed fix is currently on ai2-test and we're working to finalize it.

Sounds good. I just tried it out and everything seemed to work as normal on ai2-test.

The fix should be live on all servers now.

Thank you for your timely assistance! I wanted to update that the issue has been resolved.:grinning_face_with_smiling_eyes:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.