generate_measure_descriptions user doesnt belong to cluster issue
Dear Team!
I would like to invoke generate_measure_descriptions() function inside a Fabric Notebook, but I get the following error: FabricHTTPException: 401 Unauthorized for url: https://api.fabric.microsoft.com//explore/v202304/nl2nl/completions Headers: {'Content-Length': '0', 'X-PowerBI-Error-Info': 'UserDoesNotBelongToCurrentCluster', 'X-PowerBI-Error-Details': "Current user belongs to cluster '', but this request was sent to cluster: 'WABI-NORTH-EUROPE-redirect.analysis.windows.net'.", 'request-redirected': 'true', 'home-cluster-uri': 'https://wabi-north-europe-m-primary-redirect.analysis.windows.net/', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'X-Frame-Options': 'deny', 'X-Content-Type-Options': 'nosniff', 'Access-Control-Expose-Headers': 'RequestId,X-PowerBI-Error-Info,X-PowerBI-Error-Details', 'RequestId': 'xxx', 'Date': 'Tue, 14 Jan 2025 15:34:48 GMT'}
I get the same results with a specific measure + readonly = True and no measure defined + False settings.
My workspace is attached to a P4 capacity, my user is also part of the user group who can use Copilot feature and I am a Fabric administrator as well. (Also, randomly connect_semantic_model() doesnt find my model saying that it doesnt exist, but it's clearly there - I used another capacity in the beginning then i attached that P4, probably that object movement messed it up?! (even after hours)) Could you please help me finding the issue?
Thanks Jozsef
You must run this function on an F64 sku or higher as documented here.
Checking in here. Do you still get this issue when running on a Fabric capacity (F64+)? The transient issue with connect_semantic_model should now be much less frequent as changes were made to Semantic Link to ensure a better connection to the model (which was inherited by semantic link labs).
Hi Michael, Finally I got the chance to test it on an F64 instead of a P1, but I still get the same issue even as a Fabric Administrator myself. Is there any other prerequisites for the model, workspace, user who runs it?
Hello @m-kovalsky,
FYI, I tested this function today in a workspace that is backed by a F64 capacity, and I got the same error.
Quick question, will the F64 requirement be removed since all F SKUs have access to Copilot?
Hi @m-kovalsky,
I tested this function in a workspace under a F64 capacity and got the same error message as well.
Would you try 0.12.2 and let me know?
hi Michael, now i get different errors. if I execute it as myself I get this: File /nfs4/pyenv-a286b49c-5b65-42ce-9bef-78658bb95e14/lib/python3.11/site-packages/sempy_labs/tom/_model.py:4673, in TOMWrapper.generate_measure_descriptions(self, measure_name, max_batch_size) 4667 response = requests.post( 4668 f"{prefix}/explore/v202304/nl2nl/completions", 4669 headers=headers, 4670 json=payload, 4671 ) 4672 if response.status_code != 200: -> 4673 raise FabricHTTPException( 4674 f"Failed to retrieve descriptions: {response.text}" 4675 ) 4677 for item in response.json().get("modelItems", []): 4678 ms_name = item["urn"]
File /nfs4/pyenv-a286b49c-5b65-42ce-9bef-78658bb95e14/lib/python3.11/site-packages/sempy/fabric/exceptions/_exceptions.py:24, in FabricHTTPException.init(self, response) 21 self.error_reason: str 22 # The following section is copied from response.raise_for_status() 23 # ---------------------------------------------------------------- ---> 24 if isinstance(response.reason, bytes): 25 # We attempt to decode utf-8 first because some servers 26 # choose to localize their reason strings. If the string 27 # isn't utf-8, we fall back to iso-8859-1 for all other 28 # encodings. (See PR #3538) 29 try: 30 self.error_reason = response.reason.decode("utf-8")
AttributeError: 'str' object has no attribute 'reason'
If i execute it as a service principal I get this error, but not just for generate measures but even listing out tables from model. ImportError: cannot import name 'create_on_access_token_expired_callback' from 'sempy.fabric._token_provider' (/nfs4/pyenv-a286b49c-5b65-42ce-9bef-78658bb95e14/lib/python3.11/site-packages/sempy/fabric/_token_provider.py)
Let me know if you need further information!
Thanks for testing. I'm making an update in 0.12.3 so we'll see how that goes.
Please try 0.12.3.