stelace icon indicating copy to clipboard operation
stelace copied to clipboard

"INSTANT_DATA" is not internal or external command, executable program, or batch file

Open tereshchuk opened this issue 5 years ago • 26 comments

In general, we have 1 main problem, this is - "INSTANT_DATA" is not internal or external command, executable program, or batch file. When we use "yarn seed".

Maybe I need to install a package? Снимок экрана (255)

tereshchuk avatar Nov 02 '20 10:11 tereshchuk

Can you provide a translation of the message following "INSTANT_DATA" and more details about your system so we can try and help ?

EDIT: is it "is not internal or external command, executable program, or batch file" ?

By the way, it looks like you’re using Windows. As stated in the README the server is currently only tested in UNIX environment.

abruere avatar Nov 02 '20 17:11 abruere

Can you provide a translation of the message following "INSTANT_DATA" and more details about your system so we can try and help ?

EDIT: is it "is not internal or external command, executable program, or batch file" ?

By the way, it looks like you’re using Windows. As stated in the README the server is currently only tested in UNIX environment.

I myself have stelace working fine on http: // localhost: 4100 showing {"message": "Welcome to Stelace API. Please have a look at https://stelace.com/docs to see what we can build together." }. But I need to add, for example, a product to the database. For this I need to use apiKey: 'seck_test' - and with the yarn seed I am trying to create an apikey.


What is on the screen is translated like this: "INSTANT_DATA" is not internal or external command, executable program, or batch file.

tereshchuk avatar Nov 02 '20 17:11 tereshchuk

Yes indeed, you need an API key. Can you share your version of Windows ?

The problem is probably we should use cross-env to set env variables in such script lines:

https://github.com/stelace/stelace/blob/11e58c2b30c0b1bda6fc7a9499191c07387a4a03/package.json#L41

like "cross-env INSTANT_DATA=true npm test scripts/instantData.js"

abruere avatar Nov 02 '20 18:11 abruere

Yes indeed, you need an API key. Can you share your version of Windows ?

The problem is probably we should use cross-env to set env variables in such script lines:

https://github.com/stelace/stelace/blob/11e58c2b30c0b1bda6fc7a9499191c07387a4a03/package.json#L41

like "cross-env INSTANT_DATA=true npm test scripts/instantData.js"

I have WINDOWS 10 normal.

tereshchuk avatar Nov 02 '20 18:11 tereshchuk

Yes indeed, you need an API key. Can you share your version of Windows ?

The problem is probably we should use cross-env to set env variables in such script lines:

https://github.com/stelace/stelace/blob/11e58c2b30c0b1bda6fc7a9499191c07387a4a03/package.json#L41

like "cross-env INSTANT_DATA=true npm test scripts/instantData.js"

Did as you said, now it shows. Снимок экрана (258)

tereshchuk avatar Nov 02 '20 18:11 tereshchuk

I suppose you ran yarn add -D cross-env first ? If you were able to run the server before, bluebird is supposed to be installed. Can you try to start the server again?

@woyuen or I will look at this cross-platform issue in the morning.

abruere avatar Nov 02 '20 19:11 abruere

I suppose you ran yarn add -D cross-env first ? If you were able to run the server before, bluebird is supposed to be installed. Can you try to start the server again?

@woyuen or I will look at this cross-platform issue in the morning.

I still have an error but this one.

Can we go to Telegram or WhatsApp? Снимок экрана (259)

tereshchuk avatar Nov 02 '20 22:11 tereshchuk

Again, can you translate your message ending with .length? It seems related to node OS built-in module.

We don’t provide live support for community as we have live limited resources. Here it can help other users in the future.

abruere avatar Nov 03 '20 07:11 abruere

Unexpected appearance: .length.

вт, 3 нояб. 2020 г. в 09:54, Andy Bruère [email protected]:

Again, can you translate your message ending with .length? It seems related to node OS built-in module.

We don’t provide live support for community as we have live limited resources. Here it can help other users in the future.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stelace/stelace/issues/468#issuecomment-720960086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFP55LQLWQGKSBGTF5CJ4ZTSN6ZLBANCNFSM4THJV6GA .

Снимок экрана (260) Снимок экрана (261)

tereshchuk avatar Nov 03 '20 07:11 tereshchuk

We’ll try to reproduce on Windows.

Meanwhile I invite you to use a Docker container for the API server as explained in the README.

https://github.com/stelace/stelace#develop-with-api-server-container

Stelace server is built on and deployed to Linux machines (Ubuntu), and you may have some trouble running server with another OS. Docker can solve this with ease.

abruere avatar Nov 03 '20 08:11 abruere

#> We’ll try to reproduce on Windows.

Meanwhile I invite you to use a Docker container for the API server as explained in the README.

https://github.com/stelace/stelace#develop-with-api-server-container

Stelace server is built on and deployed to Linux machines (Ubuntu), and you may have some trouble running server with another OS. Docker can solve this with ease.

I have now rented a VPS on linux centos. And trying to install stelace. I'm stuck at this point, please help.

Error: connect ECONNREFUSED 127.0.0.1:6543 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) Снимок экрана (264)

tereshchuk avatar Nov 03 '20 20:11 tereshchuk

The error is about a connection issue to PostgreSQL database. Did you start databases with the command yarn docker:db beforehand?

If you did it, then there's some issue preventing the code to reach the database as connection cannot be established.

woyuen avatar Nov 04 '20 07:11 woyuen

The error is about a connection issue to PostgreSQL database. Did you start databases with the command yarn docker:db beforehand?

If you did it, then there's some issue preventing the code to reach the database as connection cannot be established.

Yes, I do as instructed. If I give you access to the server, can you show me how to run Stelace on the server? So that I can make sure that Stelace works. Снимок экрана (267)

tereshchuk avatar Nov 04 '20 08:11 tereshchuk

If you think there is problem with database containers please open a new issue.

And this time please include your development .env file, your node version, your OS version.

abruere avatar Nov 04 '20 08:11 abruere

If you think there is problem with database containers please open a new issue.

And this time please include your development .env file, your node version, your OS version.

I did it https://github.com/stelace/stelace/issues/469

tereshchuk avatar Nov 05 '20 09:11 tereshchuk

Hi Abruere, I have the same error with INSTANT_DATA when running 'yarn seed', do you have any update with this issue? Andy

andychin8 avatar May 13 '21 06:05 andychin8

Hi @andychin8, can you give more details about your environment ? (OS and node versions in particular)

abruere avatar May 17 '21 16:05 abruere

Hi @andychin8, can you give more details about your environment ? (OS and node versions in particular)

Hi Andy, Thanks for getting back, I got this running now when running in docker, I have ran the following successfully and initialise the platform POST /store/platforms POST /store/platforms/:patformId/init POST /store/platforms/:patformId/cache/sync but having issue creating ApiKey? POST http://127.0.0.1:4100//roles (have tried dev, public, user) POST http://127.0.0.1:4100/api-keys { "name": "customapikey", "roles": [], "permissions": [ "asset:create:all" ] } how do you create this apiKey without the Authorization? Are they any reference where we can find more info how you set a platform and sample?

andychin8 avatar May 17 '21 23:05 andychin8

Thanks for providing those information. You need to provide special headers that aren't documented yet because yarn seed should correctly initialize platforms. We'll add some documentation about manual platform creation.

Given you successfully created a platform, we presume you used the following headers:

  • x-stelace-system-key for the system key
  • x-stelace-env for the environment

Another header needs to be provided to target the correct platform to create the API key:

  • x-platform-id with the platform ID returned after creation

By providing those 3 headers, you can create the API key. Please note that the system key must only be used in safe environment. For unsafe environments (like client-side), API keys must be used instead.

woyuen avatar May 18 '21 07:05 woyuen

@woyuen I'm building my own setup script like in the marketplace demo including the logic to initialize the platform contained in the seed script of this project.

Basicaly, after calling the routes store.createPlatform, store.initPlatform and store.migrateDatabase I'm left with creating the API keys and seeding the marketplace default data and configurations.

The problem comes when I try to call apiKey.create with the headers you suggested (x-stelace-system-key, x-stelace-env and x-platform-id). The request is authenticated correctly but the API returns an error because the dev role that I want to assign to the API key does not exists.

I also tried creating the role calling role.create without success. It says "customRole" is not allowed.

Do you have any tips on how I should proceed?

izziaraffaele avatar Jun 30 '21 17:06 izziaraffaele

Nevermind... I think the issue was on my side. The flow I described above actually works

izziaraffaele avatar Jul 01 '21 05:07 izziaraffaele

@izziaraffaele, I confirm your flow is correct. The only thing I don't understand is why the role creation is rejected. I checked locally that it works.

Don't hesitate to post additional information if you're still blocked on this, so we can help you.

woyuen avatar Jul 01 '21 14:07 woyuen

@woyuen it was an error on my side, everything works fine now!

The seed script is very helpful to quickstart a platform for development purposes. I would make it more reusable by simply adding an option to disable hardcoded API key creation. This way I can spin up the platform, create the key myself and I'm ready to go... With this little change the seed script could be used also in other cases such as setting up staging/production environment, spinning up multiple platforms in the same server.

izziaraffaele avatar Jul 04 '21 10:07 izziaraffaele

@izziaraffaele thanks for the feedback. This improvement is a good idea. We'll consider implementing it.

woyuen avatar Jul 06 '21 10:07 woyuen

I suppose you ran yarn add -D cross-env first ? If you were able to run the server before, bluebird is supposed to be installed. Can you try to start the server again? @woyuen or I will look at this cross-platform issue in the morning.

I still have an error but this one.

Can we go to Telegram or WhatsApp? Снимок экрана (259)

I got the "tests failed' error while trying to run everything on Docker when I tried running "yarn seed". It turns out Ava's default timeout did now allow the yarn "test" script to complete. Instead, the tests timed out and were reported as failed. I added a "--timeout=5m" switch to the "test" script in package.json and both the tests and the "yarn seed" command succeeded.

Just putting it here in case it helps someone else. If other users are running into this as well, maybe someone senior can take a look at the tests or we could just consider manually overriding the timeout.

ahmed-umair avatar Jul 22 '21 12:07 ahmed-umair

One of the options is to use Linux, you could use wsl2 on Windows. These issues should not occur there.

Devesh35 avatar Apr 09 '23 22:04 Devesh35