Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Failed to create session. Unexpected token '<', "<html> <he"... is not valid JSON, when I start session #1759

Open
2 tasks done
award-adhoc opened this issue Oct 16, 2024 · 3 comments
Labels
need info More information is needed from issue creator

Comments

@award-adhoc
Copy link

award-adhoc commented Oct 16, 2024

Is this an issue specifically with Appium Inspector?

  • I have verified that my issue does not occur with Appium, and should be investigated as an Appium Inspector issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Describe the bug
When starting a session:

Error
Failed to create session. Unexpected token '<', "<html> <he"... is not valid JSON
Screenshot 2024-10-15 at 5 41 00 PM Screenshot 2024-10-15 at 5 42 01 PM

The only thing that changes the error is to remove the http:// in the Host value, which gives me a different error: Failed to create session. Unexpected token '<', "<!DOCTYPE "... is not valid JSON.

Expected Behavior

I would like to receive a clearer message.
When http:// is copied from appium,
Then warn the user that http:// shouldn't be there. Using placeholder text to communicate when a specific format is needed is not accessible, especially contrast-insufficient placeholder text.

Operating System

Mac

Appium Inspector Version

App Version: 2024.9.1

Appium Version

2.12.0

Further Information

Link to Appium Server logs
appium server log level debug

Environment

  1. Appium version (or git revision) that exhibits the issue: $ appium -v 2.12.0
  2. Last Appium version that did not exhibit the issue (if applicable): unknown
  3. Node.js version (unless using Appium.app|exe): $ node -v v22.9.0
  4. Npm or Yarn package manager: $ npm -v 10.8.3
  5. Mobile platform/version under test: Android 14
  6. Real device or emulator/simulator: emulator
  7. Appium CLI or Appium.app|exe: Appium... app. -> /.nvm/versions/node/v22.9.0/bin/appium
  8. Android Studio has Build #AI-241.19072.14.2412.12360217, built on September 12, 2024
  9. Appium doctor for android is all-clear.
@award-adhoc award-adhoc added the bug Something isn't working label Oct 16, 2024
@award-adhoc
Copy link
Author

Adding that fixing the address, but using the wrong port number produces a similarly cryptic error message, though this one is worse between the two. Thank you!

@eglitise
Copy link
Collaborator

@award-adhoc could you please provide the rest of the Appium server log, including the moment when you tried to start a session and received this error?
I do not believe the issue is caused by the http:// in the Remote Host field - I tried to start a session with the same session parameters as in your screenshot, and I got this error:
image
It's not ideal, but it does show that the attempted URL is malformed, suggesting that http:// should be removed from the Host field.

@eglitise eglitise added need info More information is needed from issue creator and removed bug Something isn't working labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info More information is needed from issue creator
Projects
None yet
Development

No branches or pull requests

3 participants
@eglitise @award-adhoc and others