Open marktani opened 6 years ago
Comment by marktani Sunday Jan 07, 2018 at 14:37 GMT
Could you please provide a minimal example that reproduces this error? 🙂
It should contain
graphcool.yml
and types.graphql
fileseed.zip
fileThanks!
Comment by nickluger Monday Jan 08, 2018 at 05:33 GMT
Hey thank you for the fast answer! 😃 here's the example!
I'm sorry, i was invoking the command from another directory. The error is resolved, if invoked from the project folder.
But even if i get no error message now,
no data gets imported, if i zip the files manually
using any zip tool.
You can check this out: https://github.com/nickluger/graphcool-manual-zip-error
If i gcf import --source export-2018-01-08T05/13/08.150Z.zip
i get all data imported correctly. I assume it uses this exporter.
The file seed.zip
was created by unzipping export-2018-01-08T05/13/08.150Z.zip
and simply rezipping it via zip -r seed.zip export-2018-01-08T05/13/08.150Z.zip
.
If you gcf import --source seed.zip
, you get no error, but there is no data imported neither..
Comment by nickluger Monday Jan 08, 2018 at 05:46 GMT
I'm currently using this for seeding. I have a seed directory checked out in source control and would like to seed the database using something like zip -r ... && gcf import ...
. If there is a smarter or alternative way to seed the db, i would be happy to know. 😄
I get this error when running prisma import --data ./data.zip
:
raven@2.3.0 alert: failed to send exception to sentry: HTTP Error (413): undefined
Error: invalid signature: 0xa
at /usr/local/lib/node_modules/prisma/node_modules/unzip/lib/parse.js:59:13
at runCallback (timers.js:773:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate [as _immediateCallback] (timers.js:711:5)
I have the same issue with graphcool-framework 0.11.5
Running it localy with npx
Also tested it running with global install, with same effect
Also tested installing graphcool-framework
as global, with same error
npx graphcool import --source data/<name>.zip --target <target_name>
graphcool -v
graphcool-framework/0.11.5 (darwin-x64) node-v8.7.0
Unzipping... ⣯
raven@2.4.0 alert: failed to send exception to sentry: HTTP Error (429): Creation of this event was denied due to rate limiting
Error: invalid signature: 0x80014
at /<project>/node_modules/unzip/lib/parse.js:59:13
at runCallback (timers.js:785:20)
at tryOnImmediate (timers.js:747:5)
at processImmediate [as _immediateCallback] (timers.js:718:5)
Also get this error
graphcool --version
graphcool-framework/0.11.5 (linux-x64) node-v6.10.3
Unzipping... ⣷
Error: invalid signature: 0x80014
at /usr/lib/node_modules/graphcool/node_modules/unzip/lib/parse.js:59:13
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
Before getting this error I also get warnings regarding graphcool.yml
[WARNING] in <path to>/graphcool.yml: A valid option to satisfy the declaration 'opt:target' could not be found.
▸ [WARNING] in <path to>/graphcool.yml: Trying to populate non string value into a string for variable ${opt:target}.
▸ Please make sure the value of the property is a string.
something to do with the target
, but just deploying to this target, with this graphcool.yml
works
Hey @WirthAware, @Melv, when you unzip the folder and import the unzipped folder, does it work then?
Wrote a quick to get this to work.. (see graphcool-cli-core/dist/commands/import)
var _this = this;
return new Promise(function (resolve, reject) {
var before = Date.now();
_this.out.action.start('Unzipping');
Minizip.unzip(_this.importPath, _this.importDir, function(err) {
if (err)
console.log(err);
else {
_this.out.action.stop(chalk_1.default.cyan(Date.now() - before + "ms"));
resolve();
}
});
// var output = unzip.Extract({ path: _this.importDir });
// fs.createReadStream(_this.importPath).pipe(output);
// output.on('close', function () {
// _this.out.action.stop(chalk_1.default.cyan(Date.now() - before + "ms"));
// resolve();
// });
});
};
But now I am getting another error Field type Json has no validator defined
. Is importing Json
not supported?
@steve-a-jones
I think I found a workaround fix:
In : graphcool/node_modules/graphcool-cli-core/dist/commands/import/Importer.js
Replace the node-unzip library with this one: https://github.com/mhr3/unzip-stream (after installing it as a dependency).
// var unzip = require("unzip");
var unzip = require("unzip-stream");
I was able to import 20k sample nodes on mac-os, but will do more testing.
This fixed my "Error: invalid signature: 0x80014" errors.
I'm also getting this error while trying to import the shared cluster nodes into my local.
From project's root
graphcool import --source export-2018-03-22T07:32:37.816Z.zip --target dev
cli-engine:plugins:manager requiring /usr/local/lib/node_modules/graphcool/node_modules/graphcool-cli-core +0ms cli-engine:plugins:manager required +3s plugin required command +3s EnvironmentMigrator graphcoolPath /Users/jpprietobaez/.graphcool does not exist +0ms Unzipping...Error: invalid signature: 0x80014 at /usr/local/lib/node_modules/graphcool/node_modules/unzip/lib/parse.js:59:13 at runCallback (timers.js:800:20) at tryOnImmediate (timers.js:762:5) at processImmediate [as _immediateCallback] (timers.js:733:5) Exiting with code: 1
Tried @niwaa unzip-stream workaround but it didnt fix it for me.
I get the error with both the untouched exported zip and also if I re-zip the folder.
graphcool-framework/0.11.5 (darwin-x64) node-v9.2.1
Issue by nickluger Sunday Jan 07, 2018 at 14:33 GMT Originally opened as https://github.com/graphcool/prisma/issues/1535
Current behavior
gcf import --source ./seed.zip
leads to:Reproduction
I'm using
graphcool-framework/0.11.4
. It's installed globally. This error happens for any zip file. Even if i put a movie in it, so i assume its not a problem with the data...Expected behavior?
It should import data correctly.