databricks-sdk-go
databricks-sdk-go copied to clipboard
[ISSUE]
Description databricks auth through databricks cli didnt work , v 0.218.0
Reproduction Error: oidc: fetch .well-known: unexpected error handling request: invalid character '<' looking for beginning of value. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:
GET /login.html?login_redirect_mode=none
> * Host:
> * Accept: application/json
> * Referer: https://<user redacted>.cloud.databricks.com/?o=2702943671319859/oidc/.well-known/oauth-authorization-server
> * User-Agent: cli/0.218.0 databricks-sdk-go/0.38.0 go/1.21.9 os/darwin cmd/auth_login
< HTTP/2.0 200 OK
< * Cache-Control: no-cache, no-store, must-revalidate
< * Content-Security-Policy: default-src *; font-src * data:; frame-src * blob:; img-src * blob: data:; media-src * data:; object-src 'none'; style-src * 'unsafe-inline'; worker-src * blob:; script-src 'self' 'unsafe-eval' 'unsafe-hashes' 'report-sample' https://*.databricks.com https://databricks.github.io/debug-bookmarklet/ https://widget.intercom.io https://js.intercomcdn.com https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js https://databricks-ui-assets.azureedge.net https://ui-serving-cdn-testing.azureedge.net https://uiserviceprodwestus-cdn-endpoint.azureedge.net https://databricks-ui-infra.s3.us-west-2.amazonaws.com https://apis.google.com https://accounts.google.com/gsi/client 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=' 'sha256-dFp3MsETjpLtd75fZD7ukiGGAZCF5jJO+fWc8DNdkh0=' 'sha256-Lh4yp7cr3YOJ3MOn6erNz3E3WI0JA20mWV+0RuuviFM=' 'sha256-7LSUKpUPKusfjd1mv6jYlF5bY1tH2q3Qe5LQFwNHmhM=' 'sha256-sboFRr4+SH08kM7Hr2Yk6OGncTNP8GG5u1qT4wf2s8o='; report-uri /ui-csp-reports; frame-ancestors *
< * Content-Type: text/html; charset=utf-8
< * Date: Tue, 26 Nov 2024 18:59:56 GMT
< * Server: databricks
< * Set-Cookie: enable-armeria-workspace-server-for-ui-flags=true; Max-Age=1800; Expires=Tue, 26 Nov 2024 19:29:56 GMT; Secure; HTTPOnly; SameSite=Strictx-serve-assets-from-prpreview=; Max-Age=0; Expires=Tue, 26 Nov 2024 18:59:56 GMT; Path=/; Secure; HTTPOnly; SameSite=Strictx-user-has-acknowledged-prpreview=; Max-Age=0; Expires=Tue, 26 Nov 2024 18:59:56 GMT; Path=/; Secure; HTTPOnly; SameSite=Strictx-serve-assets-from-git-bisect=; Max-Age=0; Expires=Tue, 26 Nov 2024 18:59:56 GMT; Path=/; Secure; HTTPOnly; SameSite=Strict
< * Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< * X-Content-Type-Options: nosniff
< * X-Request-Id: 638e27ce-ed1f-4d33-ba28-d9e9ea0c88d9
< * X-Ui-Svc: true
< * X-Xss-Protection: 1; mode=block
< <!doctype html>
< <html>
< <head>
< <meta charset="utf-8">
< <meta http-equiv="Content-Language" content="en">
< <title>Databricks - Sign In</title>
< <meta name="viewport" content="width=960">
< <link rel="icon" type="image/png" href="https://ui-assets.cloud.databricks.com/favicon.ico">
< <meta http-equiv="content-type" content="text/html; charset=UTF8">
< <script id="__databricks_react_script"></script>
< <script>window.__DATABRICKS_SAFE_FLAGS__={"databricks.fe.infra.fixConfigPrefetch":true,"databricks.fe.infra.useReact18":true,"databricks.infra.showErrorModalOnFetchError":true,"databricks.fe.infra.useReact18NewAPI":false,"databricks.fe.infra.enableImplicitContext":false},window.__DATABRICKS_CONFIG__={"isCuttingEdge":false,"publicPath":{"mlflow":"https://ui-assets.cloud.databricks.com/","dbsql":"https://ui-assets.cloud.databricks.com/","feature-store":"https://ui-assets.cloud.databricks.com/","monolith":"https://ui-assets.cloud.databricks.com/","jaws":"https://ui-assets.cloud.databricks.com/"},"isSpogDomain":false,"enablePrPreview":"","enableGitBisect":""}</script>
< <link rel="icon" href="https://ui-assets.cloud.databricks.com/favicon.ico">
< <script>
< function setNoCdnAndReload() {
< document.cookie = `x-databricks-cdn-inaccessible=true; path=/; max-age=86400`;
< const metric = 'cdnFallbackOccurred';
< const browserUserAgent = navigator.userAgent;
< const browserTabId = window.browserTabId;
< const performanceEntry = performance.getEntriesByType('resource').filter(e => e.initiatorType === 'script').slice(-1)[0]
< sessionStorage.setItem('databricks-cdn-fallback-telemetry-key', JSON.stringify({ tags: { browserUserAgent, browserTabId }, performanceEntry}));
< window.location.reload();
< }
< </script>
< <script>
< // Set a manual timeout for dropped packets to CDN
< function loadScriptWithTimeout(src, timeout) {
< return new Promise((resolve, reject) => {
< const script = document.createElement('script');
< script.defer = true;
< script.src = src;
< script.onload = resolve;
< script.onerror = reject;
< document.head.appendChild(script);
< setTimeout(() => {
< reject(new Error('Script load timeout'));
< }, timeout);
< });
< }
< loadScriptWithTimeout('https://ui-assets.cloud.databricks.com/static/js/login/login.c810ddc3.js', 10000).catch(setNoCdnAndReload);
< </script>
< </head>
< <body class="light-mode">
< <uses-legacy-bootstrap>
< <div id="login-page"></div>
< </uses-legacy-bootstrap>
< <script>const telemetryEndpoint="/telemetry-unauth?t=",uiModuleName="workspaceLogin";function shouldIgnoreError(e){return!1}function generateUuidV4(){const e=window.crypto?.randomUUID?.();return e||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)}))}function networkConnectivityTags(){const e=window.navigator.onLine,n=window.navigator.connection?.rtt??-1,t=window.navigator.connection?.downlink??-1;return{browserNavigatorOnline:e,browserConnectionEstimatedRtt:n,browserConnectionEstimatedDownlink:t,browserConnected:e&&n>0&&t>0}}function getParams(e){let n;const t=/\+/g,o=/([^&=]+)=?([^&]*)/g,r=function(e){return decodeURIComponent(e.replace(t," "))},i={};for(n=o.exec(e);n;)i[r(n[1])]=r(n[2]),n=o.exec(e);return i}function getWorkspaceParam(){const e=getParams(window.location.search.substr(1)),n=/^\d+/.exec(e?.o??"");return null===n?void 0:n[0]}function createTelemetryRequestBody(e,n={},t=null){const o=Date.now(),r={eventId:generateUuidV4(),metric:e,tags:{...n,...networkConnectivityTags(),browserTabId:window.browserTabId,browserUserAgent:navigator.userAgent},ts:o};return t&&(r.blob=t),JSON.stringify({uploadTime:o,items:[JSON.stringify(r)]})}function recordTelemetry(e,n={},t=""){const o=getWorkspaceParam(),r=o?{"X-Databricks-Org-Id":o.toString()}:{},i={method:"POST",credentials:"include",body:createTelemetryRequestBody(e,n,t),headers:r};fetch(telemetryEndpoint+Date.now(),i)}window.__databricks_networkConnectivityTags=networkConnectivityTags,Object.defineProperty(window,"browserTabId",{value:generateUuidV4()}),window.recordTelemetry=recordTelemetry,recordTelemetry("uiInit",{uiModule:uiModuleName,eventId:"init",eventClientSource:uiModuleName,eventType:"init"});let logCount=0;function error_handler(e,n,t,o,r){logCount++>4||shouldIgnoreError(e)||recordTelemetry("uncaughtJsException",{eventType:"jsExceptionV3",jsExceptionMessage:e,jsExceptionSource:n,jsExceptionLineno:t,jsExceptionColno:o,jsExceptionBeforeInit:!0},r&&r.stack&&r.stack.toString())}function sendBeaconOnPageExit(e){if(navigator.sendBeacon){const n=e&&e.type||"unknown",t=(Date.now(),createTelemetryRequestBody("uiInit",{eventType:"pageExitBeforeAppInitComplete",eventName:n,eventClientSource:uiModuleName}));navigator.sendBeacon(telemetryEndpoint+Date.now(),t)}}window.onerror=error_handler,window.onunhandledrejection=function(e){error_handler(String(e.reason),null,null,null,e.reason)},window.addEventListener("beforeunload",sendBeaconOnPageExit),window.addEventListener("unload",sendBeaconOnPageExit),window.addEventListener("pagehide",sendBeaconOnPageExit),window.cleanupAfterAppInit=()=>{window.removeEventListener("beforeunload",sendBeaconOnPageExit),window.removeEventListener("unload",sendBeaconOnPageExit),window.removeEventListener("pagehide",sendBeaconOnPageExit)}</script>
< </body>
< </html>
Expected behavior databricks login using service principal client id and client secret
Is it a regression? NA
Debug Logs NA