Share via

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

Victor Buzy 25 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.


4 answers

Sort by: Most helpful
  1. Smaran Thoomu 35,045 Reputation points Microsoft External Staff Moderator
    2026-04-24T01:14:50.7833333+00:00

    Hi @Victor Buzy
    I checked a similar case internally where the same error (“Session isn’t active”) was seen after moving from Spark 3.4 to 3.5 when using cosmos.olap.

    In that case, the issue was related to Java module access changes in Spark 3.5, and it was resolved by adding the below configuration at the notebook level:

    %%configure -f
    {
      "conf": {
        "spark.driver.extraJavaOptions": "--add-opens java.base/sun.security.util=ALL-UNNAMED",
        "spark.executor.extraJavaOptions": "--add-opens java.base/sun.security.util=ALL-UNNAMED"
      }
    }
    

    Could you please try this once and see if it makes any difference?

    Let me know how it goes after trying this.

    0 comments No comments

  2. Victor Buzy 25 Reputation points
    2026-04-14T18:39:32.3633333+00:00

    Hi,

    Thank you for the detailed clarification.

    I understand that this is currently treated as a limitation or compatibility gap between Spark 3.5 and the Cosmos OLAP connector via Synapse Link. However, given the impact on our platform, I would like to clarify and escalate this further.

    At the moment, this situation creates a blocking dependency for us:

    Spark 3.4 is approaching end of support and we are expected to migrate

    Cosmos OLAP workloads (critical for us) are not functional on Spark 3.5

    There is no documented limitation, no ETA, and no clear migration path

    From our perspective, this behaves like a regression:

    Same code

    Same configuration

    Works in 3.4

    Fails deterministically in 3.5 at execution time with session invalidation

    Could you please help with the following:

    Can this be formally confirmed as a known product limitation or a regression/bug?

    Can this issue be escalated to the product/engineering team for investigation?

    Is there an internal tracking ID / bug ID we can follow?

    Are there any planned runtime or connector updates that target Spark 3.5 compatibility?

    Is there any official guidance for customers relying on Synapse Link OLAP during Spark migration?

    At this stage, a split strategy (3.4 for Cosmos / 3.5 for others) is operationally complex and not sustainable long term, so we need more visibility to plan accordingly.

    We are happy to provide additional logs, run tests, or validate fixes if needed.

    Thanks again for your support — we would really appreciate help in getting this in front of the relevant engineering team.

    Best regards,
    Victor


  3. Victor Buzy 25 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

  4. 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.