Share via

Spark 3.5 - Cosmos OLAP read fails with "Session isn't active" while working in Spark 3.4

Victor Buzy 20 Reputation points
2026-04-01T19:36:15.84+00:00

🔹 Description

We are currently migrating workloads from Azure Synapse Spark 3.4 to Spark 3.5.

We are experiencing an issue when reading data from Azure Cosmos DB using Synapse Link (cosmos.olap).

The exact same code works perfectly in Spark 3.4, but consistently fails in Spark 3.5.


🔹 Minimal Repro Code

df = spark.read \

🔹 Observed Behavior

  • Spark session starts successfully:
    • Apache Spark session started... Running
    • Immediately after executing the first action:
InvalidHttpRequest:

🔹 Expected Behavior

  • The notebook should successfully read data from Cosmos DB as it does in Spark 3.4.
  • df.limit(1).show() should return data.

🔹 Additional Context

  • The issue occurs even with minimal code (no transformations).
  • The issue seems specific to cosmos.olap (Synapse Link).
  • SQL-based notebooks work correctly in Spark 3.5.
  • The same Cosmos notebook works without any issue in Spark 3.4.
  • Spark session appears to start but becomes inactive immediately afterward.

    🔹 Description

    We are currently migrating workloads from Azure Synapse Spark 3.4 to Spark 3.5. We are experiencing an issue when reading data from Azure Cosmos DB using Synapse Link (cosmos.olap). The exact same code works perfectly in Spark 3.4, but consistently fails in Spark 3.5.

    🔹 Minimal Repro Code

      df
    

    🔹 Observed Behavior

    • Spark session starts successfully:
    • Apache Spark session started... Running
  • Immediately after executing the first action:
  InvalidHttpRequest: 
## 🔹 Expected Behavior
```  -  The notebook should successfully read data from Cosmos DB as it does in Spark 3.4. 

- `df.limit(1).show()` should return data. 

    ## 🔹 Additional Context

  -  The issue occurs even with minimal code (no transformations). 
  
  -  The issue seems specific to `cosmos.olap` (Synapse Link). 
  
  -  SQL-based notebooks work correctly in Spark 3.5. 
  
  -  The same Cosmos notebook works without any issue in Spark 3.4. 
  
  -  Spark session appears to start but becomes inactive immediately afterward.
  
## 🔹 Error Trace ID


```dockerfile
e9c2162f-93e2-46a0-ac70-91bc47fde292

🔹 Environment Details

  • Spark Version: 3.5
  • Node Size: (ex: Medium 8 vCores)
  • Autoscale: *(ex: 1–10 nodes)
    *See picture attached
    User's image

🔹 Impact

This issue is blocking migration of Cosmos-based workloads to Spark 3.5.

To recap: To clarify the issue, here is the clean minimal repro and context.

Description:

We are migrating workloads from Azure Synapse Spark 3.4 to Spark 3.5.

We are experiencing an issue when reading data from Azure Cosmos DB using Synapse Link (cosmos.olap).

The exact same code works correctly in Spark 3.4, but consistently fails in Spark 3.5.

Minimal repro code:

df = spark.read \

.format("cosmos.olap") \

.option("spark.synapse.linkedService", "DATABASE") \

.option("spark.cosmos.container", "TABLE") \

.load()
```df.limit(1).show()

Observed behavior:

- Spark session starts successfully and shows as Running

- Immediately after executing the first action, the notebook fails with:

InvalidHttpRequest: Submission failed due to error content =["requirement failed: Session isn't active."]

HTTP status code: 400

Trace ID: e9c2162f-93e2-46a0-ac70-91bc47fde292

Expected behavior:

- The notebook should successfully read data from Cosmos DB in Spark 3.5, as it does in Spark 3.4

- df.limit(1).show() should return data

Additional context:

- The issue occurs even with minimal code and no transformations

- The issue seems specific to cosmos.olap (Synapse Link)

- SQL-based notebooks work correctly in Spark 3.5

- The same Cosmos notebook works without any issue in Spark 3.4

- Spark session appears to start, then becomes inactive immediately afterward

Environment:

- Spark version: 3.5

- Node size: Medium (8 vCores / 64 GB)

- Autoscale: Enabled (3 to 10 nodes)

- Dynamic allocation: Enabled

- Default executors: 1 to 4

- Python version: 3.11

- Delta Lake version: 3.2

Impact:

This issue is blocking migration of Cosmos-based workloads to Spark 3.5.
Azure Synapse Analytics
Azure Synapse Analytics

An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.


2 answers

Sort by: Most helpful
  1. Victor Buzy 20 Reputation points
    2026-04-06T13:14:10.3366667+00:00

    Hi @Anonymous

    Thank you for your response.

    However, this situation is blocking our migration strategy.

    On one hand, Spark 3.4 is reaching end of support and we are encouraged to migrate to Spark 3.5.

    On the other hand, Cosmos OLAP workloads are currently not working on Spark 3.5 and you are advised to remain on Spark 3.4.

    This creates a contradiction, as we cannot fully migrate our platform while Cosmos OLAP is not supported or stable in Spark 3.5.

    Could you please clarify:

    1. Is this a known limitation or a confirmed bug in Spark 3.5 with cosmos.olap?
    2. Is there an official ETA or roadmap for a fix or support in Spark 3.5?
    3. Are there any recommended workarounds or alternative approaches for Cosmos workloads in Spark 3.5?
    4. Should we expect an upcoming patch or runtime update?
    5. What is the expected sunset date of spark 3.4, will it be removed from the cloud at what point of time?

    This issue is critical for us as it directly blocks the migration of Cosmos-based workloads.

    Thank you for your support.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.