500 when importing .zip file
For the description of this issue I am going to copy a description from a stackoverflow post that was not asked by me but the issues is one in the same:
"I have a working Wit.Ai application, and want to export, then import it into another Wit.Ai account. I exported the application into a zip file. And there comes trouble: When trying to import the file back into the new account: "We are creating your instance. Please do not refresh" is displayed for several minutes, then, dissapears, without any success or failure message. And no new project is created...
The project I'm trying to import is not huge at all; the .zip file is 3KB, and, got only 4 files in the entities directory."
original post: http://stackoverflow.com/questions/42279826/wit-ai-the-screen-is-stalled-while-importing-application
Similar issue here. We tried to upload a zip (with an extended expressions.js-file so as to provide more training data to wit.ai). After uploading the zip, the app was created after some minutes of waiting. We then downloaded the zip-backup to check if everything was imported and noticed that only a part of the expressions.js-file was imported. How can this issue be fixed? Unfortunately, not being able to import backup-data seriously limits the usefulness of wit.ai for us…
Having the same issue, though with a big app and the files are modified by me before reimporting - so it might me my fault. But the app appears to import without an error message. If I go look at the import then the entities were imported correctly, but many of the stories are missing. I've emailed the file I'm trying to import to Willy and Laurent. It would be great if the import system was more verbose.
Facing the same problem, I exported my app, then deleted it from my account, then while creating the same app again I imported the downloaded zip and its stuck at "We are creating your instance. Please do not refresh".
I experienced the same problem. It seems that the server returns an error after a couple of minutes and only processes the data during that time. I get error code 500 (Internal Server Error) with the error message "Something went wrong. We've been notified."
+1 This is happening with me event with a untouched .zip.
If it helps, I'm getting this log in my console:

Remembering that I didn't chance the .zip that was created by the web app.
@AndreasGassmann @JoabMendes @swapkh91 @hactar @jfrehner @maximFromThe6ix are you all trying to import legacy apps (without Stories) ? I'll make this ticket a feature request to make the import work for older apps. This is on our roadmap, but with low priority for now.
I'm trying to import the data from an app with stories, so I wouldn't call it a legacy app
@blandinw No, this is a stories based app (though I have manipulated the json files to add more stuff, so it may be my fault, but I have no way of knowing as we don't get any feedback on the import). Check your emails, I've just sent two zips I'm trying to import.
@blandinw No, it's a recent one and with stories.
Ok, then it is a bug with import, and bumping to hi-pri.
@blandinw Same here. I exported the project, modified the json, and then uploaded it again.
@AndreasGassmann just checking did you use this zip command?
zip FlowBased_SimpleExample.zip FlowBased_SimpleExample/app.json FlowBased_SimpleExample/entities/*.json FlowBased_SimpleExample/actions.json FlowBased_SimpleExample/stories.json FlowBased_SimpleExample/expressions.json
I used the command provided in the app.json. The import "worked", it just didn't import everything (it randomly stops after about 5 minutes giving me an internal error (500)).
@AndreasGassmann how many expressions did you have in your expressions.json?
I don't know how many expressions there are. The expressions.json file is about 10'000 lines long. I simply exported my app and imported the (untouched) zip file again, getting the following error.
Failed to load resource: the server responded with a status of 504 (Server timeout)
common.fa5a69a….js:58 error while importing SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at XMLHttpRequest.i.onreadystatechange
Same with me. I exported the app and then tried to import the same zip file, untouched and it was stuck at "We are creating your instance. Please do not refresh" for a long time and finally failed.
Ha. 504 is different than 500. We should import apps in an async way and send an email when the import job is done. It would be useful to have a few zip files that cause the bug. Can some of you send an email with your .zip attached with subject "GitHub issue #381: cannot import" to $my_first_name at fb.com?
I know that a 504 and 500 error are not the same. Last week I got a 500, just like described above. Today I get a 504 after exactly 2 minutes. I am sure that it took more than 2 minutes last week, so maybe you changed the timeout? 😄 I agree that the importing should be done asynchronously. Maybe you could redirect the user to the new app after the upload completed and show a progress bar until the project has been fully imported?
Indeed, we started using new load balancers with a more aggressive timeout this week :-) We'll implement the async thing, but this is low pri compared to what we're working on. Can I ask how big your .zip file was given that it took 5min to upload? We should probably allow importing values and expressions after an app has been created, to make the initial import more likely to succeed.
I could make the upload today, but it still threw an error and stuck on the /new page without any message displayed. However, When I loaded the home page the new app was listed there with all the entities that where on my .zip.
The log says that the error is something about json parsing, but I had validated all the json files on my .zip using http://jsonlint.com/. So, this error is weird.
This is a screenshot from my log:
