question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin SDK: all_projects() fails with 'Cannot deserialize value of type `com.looker.sdk.GitApplicationServerHttpScheme`'

See original GitHub issue

With the latest Kotlin sources, running against Looker 21.0.34.

  1. I created a blank project via the Web UI, and configured it to point to a Custom Git Repository (CodeCommit).
  2. After it’s created successfully, using the Kotlin SDK, I call update_session() to set the session and then all_projects() but it fails with:
Calling update_session(): body=WriteApiSession(workspace_id=dev)
Response: ApiSession(can={view=true, update=true}, workspace_id=dev, sudo_user_id=null)
Calling all_projects()
Response: SDKErrorResponse(value=GET /projects com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.looker.sdk.GitApplicationServerHttpScheme` from String "": not one of the values accepted for Enum class: [http, https]
 at [Source: (String)"[{"id":"reports","name":"reports","git_remote_url":"https://...,"git_username":"...",""[truncated 625 chars]; line: 1, column: 372] (through reference chain: java.lang.Object[][0]->com.looker.sdk.Project["git_application_server_http_scheme"]))
...
	at com.looker.rtl.APIMethods.ok(APIMethods.kt:38) ~[kotlin-sdk-4.0.0.2.jar:na]

This worked until recently - I just updated to get the latest fix in 544.

sdk.update_project() is now also failing with a 422 and perhaps it’s the same issue. Without being able to get projects, not clear how to debug further

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jkastercommented, Apr 23, 2021

So glad you have a work-around!

FWIW I’ve removed that enum constraint for future Looker releases (because the spec doesn’t match reality) so the Kotlin SDK will be happy when we regenerate it after the API spec is updated. It will be a nullable string instead of an enum then.

Normally, we want more in our spec for clarity and integrity, but only if the enum is always guaranteed to have an established value. You receiving "" when I receive null in my tests still puzzles me, though. I haven’t figured out the circumstance that causes it.

And, now I won’t have to. 😉

1reaction
frankspeakcommented, Apr 23, 2021

@jkaster , thank you for the suggestion - will give it a try tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Looker SDK Basic Error
I get the following error when making a basic API call. I have setup env variables, and included the port number at the...
Read more >
Issues · looker-open-source/sdk-codegen - GitHub
One SDK to rule them all, and in the codegen bind them - Issues ... Looker SDK error with python/ubuntu ... What is...
Read more >
Looker API SDKs - Google Cloud
Looker offers an official Looker API client SDK in several languages: Ruby: You can install the Ruby SDK as a gem from rubygems.org....
Read more >
Cannot find type definition file for 'request': ERROR in ...
I'm not well versed in Angular, but I think that error is a red herring. You're trying to use the Node version of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found