[GH-ISSUE #3554] [bug]: "Error while importing: format not recognized" when importing a single environment #1218

Open
opened 2026-03-16 19:18:50 +03:00 by kerem · 36 comments
Owner

Originally created by @crossbone-magister on GitHub (Nov 15, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3554

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When exporting a single environment and then reimporting, the following error shows up:
image

When exporting all the environments, no errors show up. This works whether all is one or multiple environments.

If you use both export methods in an hoppscotch installation that only has one registered environment, the only difference in the two export files is that the first one contains a JSON object, while the second one contains an array of JSON objects.

Steps to reproduce

  1. Go to the Environments sidebar
  2. Select an environment to export
  3. Click on the kebab menu icon on the right of the environment and select 'Export as JSON'
  4. Click on the Environment Import/Export button
  5. Select 'Import from Hoppscotch'
  6. Select the downloaded file of the environment just exported
  7. Error appears

Environment

Release

Version

Local

Originally created by @crossbone-magister on GitHub (Nov 15, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3554 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When exporting *a single* environment and then reimporting, the following error shows up: ![image](https://github.com/hoppscotch/hoppscotch/assets/12892649/4267957c-1148-435e-a5fe-6a68a2ae8540) When exporting *all* the environments, no errors show up. This works whether *all* is one or multiple environments. If you use both export methods in an hoppscotch installation that only has one registered environment, the only difference in the two export files is that the first one contains a JSON object, while the second one contains an array of JSON objects. ### Steps to reproduce 1. Go to the Environments sidebar 2. Select an environment to export 3. Click on the kebab menu icon on the right of the environment and select 'Export as JSON' 4. Click on the Environment Import/Export button 5. Select 'Import from Hoppscotch' 6. Select the downloaded file of the environment just exported 7. Error appears ### Environment Release ### Version Local
Author
Owner

@liyasthomas commented on GitHub (Nov 16, 2023):

@JoelJacobStephen can you take a look into this?

<!-- gh-comment-id:1813760819 --> @liyasthomas commented on GitHub (Nov 16, 2023): @JoelJacobStephen can you take a look into this?
Author
Owner

@DanielAttali commented on GitHub (Dec 3, 2023):

Hi @crossbone-magister
Ensure the JSON file has square brackets at the beginning and end.
When exporting, a JSON file is downloaded without square brackets at the beginning and end, so when you try to import the same file, an error occurs.

<!-- gh-comment-id:1837432519 --> @DanielAttali commented on GitHub (Dec 3, 2023): Hi @crossbone-magister Ensure the JSON file has square brackets at the beginning and end. When exporting, a JSON file is downloaded without square brackets at the beginning and end, so when you try to import the same file, an error occurs.
Author
Owner

@crossbone-magister commented on GitHub (Dec 3, 2023):

Hi @DanielAttali, thanks for your reply.
I also pointed out the missing square brackets in my original description, though not explicitly:

the only difference in the two export files is that the first one contains a JSON object, while the second one contains an array of JSON objects.

What you are suggesting is what I eventually did to move forward with the import, but it feels like a workaround to me.
I believe it would be best for the import and export files to have a consistent format instead of having the user to play around with them to make the import work. What do you think about it?

In any case this is just my personal opinion, it's ultimately up to the hoppscotch team to decide if they consider it an issue and what is the best approach to solve it.

<!-- gh-comment-id:1837482497 --> @crossbone-magister commented on GitHub (Dec 3, 2023): Hi @DanielAttali, thanks for your reply. I also pointed out the missing square brackets in my original description, though not explicitly: > the only difference in the two export files is that the first one contains a JSON object, while the second one contains an array of JSON objects. What you are suggesting is what I eventually did to move forward with the import, but it feels like a *workaround* to me. I believe it would be best for the import and export files to have a consistent format instead of having the user to play around with them to make the import work. What do you think about it? In any case this is just my personal opinion, it's ultimately up to the hoppscotch team to decide if they consider it an issue and what is the best approach to solve it.
Author
Owner

@nnmer commented on GitHub (Dec 27, 2023):

Feels like this is still an issue. I can re-import exported env.json (with 1 environment collection) but if I have another file with the simplest content as below - constantly getting "File format not recognized.". Adding this new environment into the previously exported env.json with existed environment produce same error

[
  {
    "name": "app",
    "variables": [
      {
        "key": "host",
        "value": "http://localhost:8000"
      }
    ]
  }
]

Hoppscotch Desktop App v2023.12.1-1

<!-- gh-comment-id:1870472935 --> @nnmer commented on GitHub (Dec 27, 2023): Feels like this is still an issue. I can re-import exported env.json (with 1 environment collection) but if I have another file with the simplest content as below - constantly getting "File format not recognized.". Adding this new environment into the previously exported env.json with existed environment produce same error ``` [ { "name": "app", "variables": [ { "key": "host", "value": "http://localhost:8000" } ] } ] ``` Hoppscotch Desktop App v2023.12.1-1
Author
Owner

@liyasthomas commented on GitHub (Dec 27, 2023):

@jamesgeorge007 @amk-dev can you look into this?

<!-- gh-comment-id:1870481343 --> @liyasthomas commented on GitHub (Dec 27, 2023): @jamesgeorge007 @amk-dev can you look into this?
Author
Owner

@jamesgeorge007 commented on GitHub (Dec 28, 2023):

Hi @nnmer, I couldn't reproduce the issue with the above environment JSON file.

Adding this new environment into the previously exported env.json with existed environment produce same error.

Can you provide a sample environment JSON file that will help reproduce the issue? Also, can you check if it's reproducible on hoppscotch.io?

<!-- gh-comment-id:1870800287 --> @jamesgeorge007 commented on GitHub (Dec 28, 2023): Hi @nnmer, I couldn't reproduce the issue with the above environment JSON file. > Adding this new environment into the previously exported env.json with existed environment produce same error. Can you provide a sample environment JSON file that will help reproduce the issue? Also, can you check if it's reproducible on [hoppscotch.io](https://hoppscotch.io/)?
Author
Owner

@nnmer commented on GitHub (Dec 29, 2023):

@jamesgeorge007 , I've played a bit more, maybe restart of OS and App helped, it does work now.
But, I've found that the values in json should not contain numbers as a number, but strings instead. If all values to be converted to strings and updated format to native Hoppscotch - I've managed to import my Postman env. collection.

<!-- gh-comment-id:1872119042 --> @nnmer commented on GitHub (Dec 29, 2023): @jamesgeorge007 , I've played a bit more, maybe restart of OS and App helped, it does work now. But, I've found that the values in json should not contain numbers as a number, but strings instead. If all values to be converted to strings and updated format to native Hoppscotch - I've managed to import my Postman env. collection.
Author
Owner

@liyasthomas commented on GitHub (Jan 2, 2024):

Thanks for your patience and valuable feedback. This feature has been implemented in the latest release.

Closing this ticket as this feature is now available in the recent version. Feel free to reach out if you encounter any further concerns.

<!-- gh-comment-id:1874004513 --> @liyasthomas commented on GitHub (Jan 2, 2024): Thanks for your patience and valuable feedback. This feature has been implemented in the latest release. Closing this ticket as this feature is now available in the recent version. Feel free to reach out if you encounter any further concerns.
Author
Owner

@aakrem commented on GitHub (Jan 18, 2024):

Still getting the same error. from client version and from website.

<!-- gh-comment-id:1897983545 --> @aakrem commented on GitHub (Jan 18, 2024): Still getting the same error. from client version and from website.
Author
Owner

@jamesgeorge007 commented on GitHub (Jan 18, 2024):

@aakrem, can you share the steps to reproduce? Possibly a sample environment JSON file.

<!-- gh-comment-id:1898000510 --> @jamesgeorge007 commented on GitHub (Jan 18, 2024): @aakrem, can you share the steps to reproduce? Possibly a sample environment JSON file.
Author
Owner

@aakrem commented on GitHub (Jan 18, 2024):

@jamesgeorge007 sure, it's a JSON format and I am trying to import it from this URL: https://cloud.agenta.ai/api/openapi.json

<!-- gh-comment-id:1898009615 --> @aakrem commented on GitHub (Jan 18, 2024): @jamesgeorge007 sure, it's a JSON format and I am trying to import it from this URL: https://cloud.agenta.ai/api/openapi.json
Author
Owner

@aakrem commented on GitHub (Jan 18, 2024):

@jamesgeorge007 any idea if we can solve this soon?

<!-- gh-comment-id:1898930960 --> @aakrem commented on GitHub (Jan 18, 2024): @jamesgeorge007 any idea if we can solve this soon?
Author
Owner

@jamesgeorge007 commented on GitHub (Jan 18, 2024):

Hi, we'll investigate this and get back.

<!-- gh-comment-id:1899003863 --> @jamesgeorge007 commented on GitHub (Jan 18, 2024): Hi, we'll investigate this and get back.
Author
Owner

@jamesgeorge007 commented on GitHub (Jan 22, 2024):

@aakrem, a CORS error occurs while attempting to fetch from the above URL. We're tracking this internally. In the meantime, you can use an extension that adds the Access-Control-Allow-Origin: * rule to the response header. For instance, Allow CORS: Access-Control-Allow-Origin.

<!-- gh-comment-id:1903553794 --> @jamesgeorge007 commented on GitHub (Jan 22, 2024): @aakrem, a CORS error occurs while attempting to fetch from the above URL. We're tracking this internally. In the meantime, you can use an extension that adds the `Access-Control-Allow-Origin: *` rule to the response header. For instance, [Allow CORS: Access-Control-Allow-Origin](https://chromewebstore.google.com/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf?pli=1).
Author
Owner

@pritammobisoft commented on GitHub (Apr 1, 2024):

Is there any update on this? This is not just related to CORS. I tried to import a OpenAPI 3.01 JSON file which was saved to disc. Even then this error came. The JSON file was generated automatically by Spring Boot and works with OpenAPI viewer.

<!-- gh-comment-id:2029602650 --> @pritammobisoft commented on GitHub (Apr 1, 2024): Is there any update on this? This is not just related to CORS. I tried to import a OpenAPI 3.01 JSON file which was saved to disc. Even then this error came. The JSON file was generated automatically by Spring Boot and works with OpenAPI viewer.
Author
Owner

@jamesgeorge007 commented on GitHub (Apr 2, 2024):

Hi @pritammobisoft, can you help with the steps you took and a sample file to reproduce?
Please follow the steps here while importing an OpenAPI collection.

<!-- gh-comment-id:2031204161 --> @jamesgeorge007 commented on GitHub (Apr 2, 2024): Hi @pritammobisoft, can you help with the steps you took and a sample file to reproduce? Please follow the steps [here](https://docs.hoppscotch.io/documentation/features/importer#import-from-openapi) while importing an OpenAPI collection.
Author
Owner

@lin-mt commented on GitHub (Apr 22, 2024):

Hi @jamesgeorge007 Importing https://cloud.agenta.ai/api/openapi.json from URL is not working in Desktop App (windows v2024.3.0).

image

<!-- gh-comment-id:2068692953 --> @lin-mt commented on GitHub (Apr 22, 2024): Hi @jamesgeorge007 Importing https://cloud.agenta.ai/api/openapi.json from URL is not working in Desktop App (windows v2024.3.0). ![image](https://github.com/hoppscotch/hoppscotch/assets/58337359/c81d75e2-4be9-480e-bc17-c4d4ce582dd3)
Author
Owner

@matthiscock commented on GitHub (May 20, 2024):

Same for me, exports from Postman fail to import
The [] trick failed also

(Note managed to get a environment in, but never a collection)

<!-- gh-comment-id:2120231083 --> @matthiscock commented on GitHub (May 20, 2024): Same for me, exports from Postman fail to import The [] trick failed also (Note managed to get a environment in, but never a collection)
Author
Owner

@ChenE2000 commented on GitHub (May 30, 2024):

Same issue for me while try to import file http://localhost:8000/openapi.json directly exported from FastAPI swagger.

<!-- gh-comment-id:2138756136 --> @ChenE2000 commented on GitHub (May 30, 2024): Same issue for me while try to import file `http://localhost:8000/openapi.json` directly exported from FastAPI swagger.
Author
Owner

@jalotra commented on GitHub (May 30, 2024):

Same for me, when I try to import from Spring Boot OpenApi Spec !

<!-- gh-comment-id:2139798926 --> @jalotra commented on GitHub (May 30, 2024): Same for me, when I try to import from Spring Boot OpenApi Spec !
Author
Owner

@whhomi commented on GitHub (Jun 12, 2024):

Same for me, when I try to import from Flask OpenApi Spec.

<!-- gh-comment-id:2162566663 --> @whhomi commented on GitHub (Jun 12, 2024): Same for me, when I try to import from Flask OpenApi Spec.
Author
Owner

@aakrem commented on GitHub (Jun 12, 2024):

@jamesgeorge007 @liyasthomas can we reopen this issue ? it looks like it's not solved

<!-- gh-comment-id:2162657267 --> @aakrem commented on GitHub (Jun 12, 2024): @jamesgeorge007 @liyasthomas can we reopen this issue ? it looks like it's not solved
Author
Owner

@ahsanaasim commented on GitHub (Jul 4, 2024):

We are trying to switch from Insomnia. But For this issue, we got stuck. We identified an interesting thing. The exported json file from insomnia gets imported instantly in the personal workspace.

It doesn't work with the newly created workspace.

I saw the same problem is faced by others. But the issue seems to be closed without any solution.
Here is the link to the issue: https://github.com/hoppscotch/hoppscotch/issues/3975

<!-- gh-comment-id:2208138191 --> @ahsanaasim commented on GitHub (Jul 4, 2024): We are trying to switch from Insomnia. But For this issue, we got stuck. We identified an interesting thing. The exported json file from insomnia gets imported instantly in the personal workspace. **It doesn't work with the newly created workspace.** I saw the same problem is faced by others. But the issue seems to be closed without any solution. Here is the link to the issue: https://github.com/hoppscotch/hoppscotch/issues/3975
Author
Owner

@ahsanaasim commented on GitHub (Jul 4, 2024):

I have checked the network response of the API that is being called. Seems like there is one internal crash. Hope the response below helps to solve the issue

{
    "errors": [
        {
            "message": "PrismaClientKnownRequestError: \nInvalid `tx.teamCollection.create()` invocation in\n/usr/src/app/src/team-collection/team-collection.service.ts:296:55\n\n  293 while (collectionProcessQueue.length > 0) {\n  294   const [parentCollID, coll] = collectionProcessQueue.shift()!;\n  295 \n→ 296   const createdColl = await tx.teamCollection.create(\nTransaction API error: Transaction already closed: Could not perform operation.",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "importCollectionsFromJSON"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "stacktrace": [
                    "Error: PrismaClientKnownRequestError: ",
                    "Invalid `tx.teamCollection.create()` invocation in",
                    "/usr/src/app/src/team-collection/team-collection.service.ts:296:55",
                    "",
                    "  293 while (collectionProcessQueue.length > 0) {",
                    "  294   const [parentCollID, coll] = collectionProcessQueue.shift()!;",
                    "  295 ",
                    "→ 296   const createdColl = await tx.teamCollection.create(",
                    "Transaction API error: Transaction already closed: Could not perform operation.",
                    "    at throwErr (/usr/src/app/src/utils.ts:22:9)",
                    "    at TeamCollectionResolver.importCollectionsFromJSON (/usr/src/app/src/team-collection/team-collection.resolver.ts:291:32)",
                    "    at target (/usr/src/app/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)",
                    "    at Object.importCollectionsFromJSON (/usr/src/app/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)"
                ]
            }
        }
    ],
    "data": null
}

I saw the same problem is faced by others. But the issue seems to be closed without any solution.
Here is the link to the issue: https://github.com/hoppscotch/hoppscotch/issues/3975

<!-- gh-comment-id:2208142362 --> @ahsanaasim commented on GitHub (Jul 4, 2024): I have checked the network response of the API that is being called. Seems like there is one internal crash. Hope the response below helps to solve the issue ``` { "errors": [ { "message": "PrismaClientKnownRequestError: \nInvalid `tx.teamCollection.create()` invocation in\n/usr/src/app/src/team-collection/team-collection.service.ts:296:55\n\n 293 while (collectionProcessQueue.length > 0) {\n 294 const [parentCollID, coll] = collectionProcessQueue.shift()!;\n 295 \n→ 296 const createdColl = await tx.teamCollection.create(\nTransaction API error: Transaction already closed: Could not perform operation.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "importCollectionsFromJSON" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "stacktrace": [ "Error: PrismaClientKnownRequestError: ", "Invalid `tx.teamCollection.create()` invocation in", "/usr/src/app/src/team-collection/team-collection.service.ts:296:55", "", " 293 while (collectionProcessQueue.length > 0) {", " 294 const [parentCollID, coll] = collectionProcessQueue.shift()!;", " 295 ", "→ 296 const createdColl = await tx.teamCollection.create(", "Transaction API error: Transaction already closed: Could not perform operation.", " at throwErr (/usr/src/app/src/utils.ts:22:9)", " at TeamCollectionResolver.importCollectionsFromJSON (/usr/src/app/src/team-collection/team-collection.resolver.ts:291:32)", " at target (/usr/src/app/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)", " at Object.importCollectionsFromJSON (/usr/src/app/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)" ] } } ], "data": null } ``` I saw the same problem is faced by others. But the issue seems to be closed without any solution. Here is the link to the issue: https://github.com/hoppscotch/hoppscotch/issues/3975
Author
Owner

@balub commented on GitHub (Jul 4, 2024):

Hey @ahsanaasim if its not a problem could you share the file you were using so we can try reproducing the issue out end.

<!-- gh-comment-id:2208284312 --> @balub commented on GitHub (Jul 4, 2024): Hey @ahsanaasim if its not a problem could you share the file you were using so we can try reproducing the issue out end.
Author
Owner

@rampa2510 commented on GitHub (Jul 14, 2024):

Encountering the same issue cannot share the file since it has company data.

<!-- gh-comment-id:2227366602 --> @rampa2510 commented on GitHub (Jul 14, 2024): Encountering the same issue cannot share the file since it has company data.
Author
Owner

@sxhil7 commented on GitHub (Jul 19, 2024):

anyone solved this issue???

<!-- gh-comment-id:2238414588 --> @sxhil7 commented on GitHub (Jul 19, 2024): anyone solved this issue???
Author
Owner

@CostcoFanboy commented on GitHub (Sep 27, 2024):

Dummy fix, but I import with Postman, then dump and re-import into Hoppscotch as the import function for Postman works.

<!-- gh-comment-id:2379205092 --> @CostcoFanboy commented on GitHub (Sep 27, 2024): Dummy fix, but I import with Postman, then dump and re-import into Hoppscotch as the import function for Postman works.
Author
Owner

@LucasVos commented on GitHub (Oct 2, 2024):

Any status update on this issue? We use .NET Swagger generated specs. same error as everyone else.

<!-- gh-comment-id:2388796261 --> @LucasVos commented on GitHub (Oct 2, 2024): Any status update on this issue? We use .NET Swagger generated specs. same error as everyone else.
Author
Owner

@Jrb1x commented on GitHub (Nov 1, 2024):

Same here. First time trying Hoppscotch and shocked that I can't import an OpenAPI spec.

<!-- gh-comment-id:2451900095 --> @Jrb1x commented on GitHub (Nov 1, 2024): Same here. First time trying Hoppscotch and shocked that I can't import an OpenAPI spec.
Author
Owner

@ianmuhia commented on GitHub (Dec 2, 2024):

same here

<!-- gh-comment-id:2510357405 --> @ianmuhia commented on GitHub (Dec 2, 2024): same here
Author
Owner

@vladimir-cloudypro commented on GitHub (Jan 5, 2025):

I noticed that the issue is happening on files bigger than "700 KB". As long as you are not on the Personal Workspace. @liyasthomas

<!-- gh-comment-id:2571733693 --> @vladimir-cloudypro commented on GitHub (Jan 5, 2025): I noticed that the issue is happening on files bigger than "700 KB". As long as you are not on the Personal Workspace. @liyasthomas
Author
Owner

@salmanarshad321 commented on GitHub (Apr 17, 2025):

I noticed that the issue is happening on files bigger than "700 KB". As long as you are not on the Personal Workspace. @liyasthomas

even on a paid plan?

<!-- gh-comment-id:2813242620 --> @salmanarshad321 commented on GitHub (Apr 17, 2025): > I noticed that the issue is happening on files bigger than "700 KB". As long as you are not on the Personal Workspace. [@liyasthomas](https://github.com/liyasthomas) even on a paid plan?
Author
Owner

@kidfromjupiter commented on GitHub (Oct 31, 2025):

I noticed that the issue is happening on files bigger than "700 KB". As long as you are not on the Personal Workspace. @liyasthomas

I can confirm this. I imported a 3.1Mb postman export into my personal workspace no problem. But could never import it into my free tier team workspace

<!-- gh-comment-id:3474113346 --> @kidfromjupiter commented on GitHub (Oct 31, 2025): > I noticed that the issue is happening on files bigger than "700 KB". As long as you are not on the Personal Workspace. [@liyasthomas](https://github.com/liyasthomas) I can confirm this. I imported a 3.1Mb postman export into my personal workspace no problem. But could never import it into my free tier team workspace
Author
Owner

@adam-cobb commented on GitHub (Feb 3, 2026):

I'm seeing this issue as well, as above, I cannot import a larger (7MB) Postman JSON into anything other than my personal workspace, it even fails the same if I first import to personal then try and do a workspace import to the team workspace, I still see the "Format not recognised error"

Is there any update on this please, as this is the only thing holding us back from switching away from Postman.

Thanks.

<!-- gh-comment-id:3841148983 --> @adam-cobb commented on GitHub (Feb 3, 2026): I'm seeing this issue as well, as above, I cannot import a larger (7MB) Postman JSON into anything other than my personal workspace, it even fails the same if I first import to personal then try and do a workspace import to the team workspace, I still see the "Format not recognised error" Is there any update on this please, as this is the only thing holding us back from switching away from Postman. Thanks.
Author
Owner

@Michahide commented on GitHub (Mar 2, 2026):

still experience the same issue, is there any upcoming fix?

I'm seeing this issue as well, as above, I cannot import a larger (7MB) Postman JSON into anything other than my personal workspace, it even fails the same if I first import to personal then try and do a workspace import to the team workspace, I still see the "Format not recognised error"

Is there any update on this please, as this is the only thing holding us back from switching away from Postman.

Thanks.

<!-- gh-comment-id:3981849701 --> @Michahide commented on GitHub (Mar 2, 2026): still experience the same issue, is there any upcoming fix? > I'm seeing this issue as well, as above, I cannot import a larger (7MB) Postman JSON into anything other than my personal workspace, it even fails the same if I first import to personal then try and do a workspace import to the team workspace, I still see the "Format not recognised error" > > Is there any update on this please, as this is the only thing holding us back from switching away from Postman. > > Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1218
No description provided.