<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[119 x 32 1 Hidden Terminal give me a title:  MongoServerError during import: &quot;Given transaction number does not match any in-progress transactions&quot;]]></title><description><![CDATA[<p>Hello,<br />
I'm running into a MongoDB transaction error when using the import API and I wanted to report it in case it's a known issue or something worth looking into.</p>
<p>Environment<br />
jsreport: 4.12.0<br />
@jsreport/jsreport-core: 4.9.0<br />
@jsreport/jsreport-import-export: 4.1.0<br />
@jsreport/jsreport-mongodb-store: 4.0.0<br />
mongodb driver: 6.6.2<br />
MongoDB: Replica Set (Azure Atlas)<br />
Store provider: mongodb<br />
What happens<br />
When calling POST /api/import to import a .jsrexport file, the import fails with:</p>
<pre><code>MongoServerError: Given transaction number 1 does not match any in-progress transactions. The active transaction number is -1
</code></pre>
<p>The error is logged as:</p>
<pre><code>warn: Unable to insert an entity (folders) &quot;/OUR_FOLDER&quot; during the import: MongoServerError: Given transaction number 1 does not match any in-progress transactions. The active transaction number is -1
</code></pre>
<p>How to reproduce</p>
<ol>
<li>Configure jsreport with store.provider: &quot;mongodb&quot; on a replica set</li>
<li>Delete several top-level folders containing many child entities (templates, scripts, assets) via the OData API</li>
<li>Wait ~few seconds</li>
<li>Call POST /api/import with a zip file that re-creates those same folders and entities</li>
</ol>
<p>The import fails with the transaction error above</p>
<p><strong>What I found</strong><br />
The error originates from the transaction block in @jsreport/jsreport-import-export/lib/import/index.js (around lines 294-310), where beginTransaction is called and then entity records are persisted sequentially inside the transaction.</p>
<p>It seems like MongoDB is rejecting the write operations within the transaction due to a conflict with the recently completed delete operations on the same collections. The transaction number -1 indicates the server considers no transaction to be active, even though the client session believes one is in progress.</p>
<p>I also noticed that, in our case, the import appeared to succeed from the caller's perspective (our code was not checking the HTTP response status — that's on us and we've fixed it). But I wanted to flag the underlying transaction issue since it could affect other users as well.</p>
]]></description><link>https://forum.jsreport.net/topic/3527/119-x-32-1-hidden-terminal-give-me-a-title-mongoservererror-during-import-given-transaction-number-does-not-match-any-in-progress-transactions</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 10:53:14 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3527.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Mar 2026 09:43:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 119 x 32 1 Hidden Terminal give me a title:  MongoServerError during import: &quot;Given transaction number does not match any in-progress transactions&quot; on Invalid Date]]></title><description><![CDATA[<p>Hello,<br />
I'm running into a MongoDB transaction error when using the import API and I wanted to report it in case it's a known issue or something worth looking into.</p>
<p>Environment<br />
jsreport: 4.12.0<br />
@jsreport/jsreport-core: 4.9.0<br />
@jsreport/jsreport-import-export: 4.1.0<br />
@jsreport/jsreport-mongodb-store: 4.0.0<br />
mongodb driver: 6.6.2<br />
MongoDB: Replica Set (Azure Atlas)<br />
Store provider: mongodb<br />
What happens<br />
When calling POST /api/import to import a .jsrexport file, the import fails with:</p>
<pre><code>MongoServerError: Given transaction number 1 does not match any in-progress transactions. The active transaction number is -1
</code></pre>
<p>The error is logged as:</p>
<pre><code>warn: Unable to insert an entity (folders) &quot;/OUR_FOLDER&quot; during the import: MongoServerError: Given transaction number 1 does not match any in-progress transactions. The active transaction number is -1
</code></pre>
<p>How to reproduce</p>
<ol>
<li>Configure jsreport with store.provider: &quot;mongodb&quot; on a replica set</li>
<li>Delete several top-level folders containing many child entities (templates, scripts, assets) via the OData API</li>
<li>Wait ~few seconds</li>
<li>Call POST /api/import with a zip file that re-creates those same folders and entities</li>
</ol>
<p>The import fails with the transaction error above</p>
<p><strong>What I found</strong><br />
The error originates from the transaction block in @jsreport/jsreport-import-export/lib/import/index.js (around lines 294-310), where beginTransaction is called and then entity records are persisted sequentially inside the transaction.</p>
<p>It seems like MongoDB is rejecting the write operations within the transaction due to a conflict with the recently completed delete operations on the same collections. The transaction number -1 indicates the server considers no transaction to be active, even though the client session believes one is in progress.</p>
<p>I also noticed that, in our case, the import appeared to succeed from the caller's perspective (our code was not checking the HTTP response status — that's on us and we've fixed it). But I wanted to flag the underlying transaction issue since it could affect other users as well.</p>
]]></description><link>https://forum.jsreport.net/post/14893</link><guid isPermaLink="true">https://forum.jsreport.net/post/14893</guid><dc:creator><![CDATA[l-dalleaste_lectra1]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to 119 x 32 1 Hidden Terminal give me a title:  MongoServerError during import: &quot;Given transaction number does not match any in-progress transactions&quot; on Invalid Date]]></title><description><![CDATA[<p>Thank you for the topic. I've tried to replicate the issue, but I can't reproduce it so far.</p>
<p>Some questions to help me isolate the problem...</p>
<p>Do you have authentication enabled?<br />
Do you reproduce the same with the local mongo single node replica?<br />
Could you upload somewhere an export with &quot;many child entities&quot; so we test on the same?</p>
]]></description><link>https://forum.jsreport.net/post/14894</link><guid isPermaLink="true">https://forum.jsreport.net/post/14894</guid><dc:creator><![CDATA[admin]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>