Skip to main content
Skip table of contents

PocketQuery Entity/File cannot be imported

This page provides a basic overview on problems that might prevent you from importing a PocketQuery file. These problems cause that either some entities are ignored or that the whole import process fails. The first type of problems (entity is ignored) will be detected in the validation phase, while import failures are detected either in the very early phase (file upload) or during the actual import process. You don’t need to worry about your data. If PocketQuery detects a problem during the import phase, all your PocketQuery data is safely reverted to the state before the import.

On this page, we will guide you through the problem analysis and hopefully help you resolve all conflicts.

Invalid PocketQuery Entity: “This entity will not be imported”

While importing an entity, you might see the following warning:

Despite that you can proceed with the import and save the entities to your Confluence, the import would not be complete. You can see the reason in the “Validation Result” section. In our case, there was a missing field value. As the content field is an essential Converter property, you either need to edit your import file manually (and insert it there), or you can continue the import (which will skip the entity).

Do you want to fix the entity by yourself? Learn more in JSON Import: How to fix failed Entity (for JSON imports) or XML Import: How to fix failed Entity (for XML imports).

PocketQuery file cannot be imported: “Import failed”

If you decide to proceed with some failed entities, there might be some other problems that could not be revealed in the validation phase. In that case, you will see the following message:

You can either fix the problem yourself or contact our Support. In the case you decide to contact us, please, download the conflicts (as shown above) and attach both the original import file and the conflicts to the support request.

The reason of this problem is generally the following: you have tried to import a file where some entities are marked as “will be skipped”. However, there are also some other entities, which are not 'skipped', and these are referencing the invalid entities. As a result, you might have a Query referencing a non-existing Datasource, Converter, or Template. This is a critical constraint violation. If such a situation is detected, the whole import will be rolled back to prevent any inconsistencies.

How can I fix this manually?

You can fix the problem but it requires some manual changes in your import file. At first, copy all IDs of the entities that are not imported:

Now you need to open your import file in a text editor and find all occurrences of this ID. Specifically, you want to find all entities that contain this ID in their “Datasource”, “Database”, “Template”, or “Converter” property. If you find such occurrence, you need to replace the value with null.

For example, let’s consider the following JSON converter (line 5):

JSON
 {
    "localId": "6f82cf3262-2e51-4e2b-8d2a-d2eb8dc87b32",
    "name": "[1/1 Import 2] Converter Invalid",
    "description": "This Converter has nothing.",
    "content": ""
}

Or alternatively in XML (line 4):

XML
<Converter>
  <name>6f82cf3262-2e51-4e2b-8d2a-d2eb8dc87b32</name>
  <displayname>[1/1 Import 2] Converter Invalid</displayname>
  <content></content>
</Converter>

The content property contains an empty value, which cannot pass the entity validation. Thus, this entity is marked as ‘skipped’. The problem occurs if there is a query referencing this Converter. Such Query looks like the following JSON (line 7):

JSON
 {
    "localId": "d90f04f3-c5ac-4ca3-9f24-12256697af79",
    "name": "[1/1 Import 2] Query valid",
    "description": "This is a REST!",
    "statement": "/region/:region",
    "datasource": "2b92600a-1bf7-431f-bcad-eb6199e0590d",
    "converter": "6f82cf3262-2e51-4e2b-8d2a-d2eb8dc87b32",
    "template": "0903633b-9426-4eac-a390-8876b1ecd920",
    "parameterTypes": {},
    "legacySpaces": null,
    "legacyIndexed": null,
    "legacyCacheDuration": null,
    "legacyJsonPath": null
},

Or alternatively in XML (line 12):

XML
<Query>
  <name>d90f04f3-c5ac-4ca3-9f24-12256697af79</name>
  <displayname>[1/1 Import 2] Query valid</displayname>
  <statement>/region/:region</statement>
  <database>2b92600a-1bf7-431f-bcad-eb6199e0590d</database>
  <template>0903633b-9426-4eac-a390-8876b1ecd920</template>
  <spaces></spaces>
  <indexed>false</indexed>
  <paramtypes class="tree-map"/>
  <cacheduration></cacheduration>
  <jsonpath></jsonpath>
  <converter>6f82cf3262-2e51-4e2b-8d2a-d2eb8dc87b32</converter>
</Query>

If you want to keep the dependent Query but remove the invalid Converter, you can simply remove the reference so the Query entity corresponds to the following JSON (note the null on the line 7):

JSON
 {
    "localId": "d90f04f3-c5ac-4ca3-9f24-12256697af79",
    "name": "[1/1 Import 2] Query valid",
    "description": "This is a REST!",
    "statement": "/region/:region",
    "datasource": "2b92600a-1bf7-431f-bcad-eb6199e0590d",
    "converter": null,
    "template": "0903633b-9426-4eac-a390-8876b1ecd920",
    "parameterTypes": {},
    "legacySpaces": null,
    "legacyIndexed": null,
    "legacyCacheDuration": null,
    "legacyJsonPath": null
},

Or alternatively for XML (note the null value on the line 6):

XML
<Query>
  <name>d90f04f3-c5ac-4ca3-9f24-12256697af79</name>
  <displayname>[1/1 Import 2] Query valid</displayname>
  <statement>/region/:region</statement>
  <database>2b92600a-1bf7-431f-bcad-eb6199e0590d</database>
  <template>0903633b-9426-4eac-a390-8876b1ecd920</template>
  <spaces></spaces>
  <indexed>false</indexed>
  <paramtypes class="tree-map"/>
  <cacheduration></cacheduration>
  <jsonpath></jsonpath>
  <converter>6f82cf3262-2e51-4e2b-8d2a-d2eb8dc87b32</converter>
</Query>

Want to learn more about PocketQuery Entity storage format? Find more details in JSON Import: How to fix failed Entity (for JSON imports) or XML Import: How to fix failed Entity (for XML imports).

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.