Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tereshchuk opened this issue Nov 2, 2020 · 26 comments

Comments

@tereshchuk
Copy link

tereshchuk commented Nov 2, 2020

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)

@abruere
Copy link
Member

abruere commented Nov 2, 2020

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.

@tereshchuk
Copy link
Author

tereshchuk commented Nov 2, 2020

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.

@abruere
Copy link
Member

abruere commented Nov 2, 2020

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:

"seed": "INSTANT_DATA=true npm test scripts/instantData.js",

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

@tereshchuk
Copy link
Author

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:

"seed": "INSTANT_DATA=true npm test scripts/instantData.js",

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

I have WINDOWS 10 normal.

@tereshchuk
Copy link
Author

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:

"seed": "INSTANT_DATA=true npm test scripts/instantData.js",

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

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

@abruere
Copy link
Member

abruere commented Nov 2, 2020

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.

@tereshchuk
Copy link
Author

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)

@abruere
Copy link
Member

abruere commented Nov 3, 2020

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.

@tereshchuk
Copy link
Author

tereshchuk commented Nov 3, 2020 via email

@abruere
Copy link
Member

abruere commented Nov 3, 2020

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.

@tereshchuk
Copy link
Author

tereshchuk commented Nov 3, 2020

#> 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 tereshchuk reopened this Nov 3, 2020
@woyuen
Copy link
Member

woyuen commented Nov 4, 2020

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.

@tereshchuk
Copy link
Author

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)

@abruere
Copy link
Member

abruere commented Nov 4, 2020

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.

@tereshchuk
Copy link
Author

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
#469

@andychin8
Copy link

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

@abruere
Copy link
Member

abruere commented May 17, 2021

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

@andychin8
Copy link

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?

@woyuen
Copy link
Member

woyuen commented May 18, 2021

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.

@izziaraffaele
Copy link

@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
Copy link

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

@woyuen
Copy link
Member

woyuen commented Jul 1, 2021

@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.

@izziaraffaele
Copy link

@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.

@woyuen
Copy link
Member

woyuen commented Jul 6, 2021

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

@ahmed-umair
Copy link

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.

@Devesh35
Copy link

Devesh35 commented Apr 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants