JetBrains / space-app-tutorials

https://www.jetbrains.com/help/space/applications.html
Apache License 2.0
22 stars 14 forks source link

Getting "301 Moved Permanently" trying out the chatbot sample #3

Open tscholze opened 2 years ago

tscholze commented 2 years ago

Hi, if I try the current sample, which seems not to be the same as on the Jetbrains.com article, I get a 301 http status code.

Ngrok seems to work. Do you have any idea?

Log output

2022-10-01 21:00:54.469 [DefaultDispatcher-worker-1] INFO  ktor.application - Responding at http://0.0.0.0:8080
2022-10-01 21:01:00.445 [eventLoopGroupProxy-4-2] DEBUG ktor.application - Unhandled: POST - /api/space. Exception class com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
</body>
</html>
"; line: 1, column: 2]]
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"<html>
<head><title>301 Moved Permanently</title></head>
...
malliaridis commented 1 year ago

When I check out the project from the repository the necessary steps to make it run for me are:

  1. Create a new application in space
  2. Get client ID and client secret
  3. Configure the application before running it locally by pasting client ID, secret and server URL in resources/application.conf)
  4. Run the application locally
  5. Run ngrok (command ngrok http 8080) and copy the URL
  6. Configure the space application by providing the ngrok URL under the Endpoint tab in form of https://[NGROK-ID].eu.ngrok.io/api/space

Then the application is ready to respond to chat messages. Have you reached that point? Or where exactly does it fail? Which step do you execute so that it causes the 301?

UPDATE: With the latest updates of Space the code examples might throw errors due to breaking changes. So make sure to update the SDK library to the newest version and fix any pending errors by providing the necessary implementation. Some of the fixes are addressed in #4.