Start a new topic
Answered

Kinvey Flex SDK

Need information on how to make use of Kinvey Flex SDK to remove the server less architecture. Any help is appreciated. 


Best Answer
Suraj,

No. We don't need to give any special access in the console in order to config the Kinvey-cli locally.

I reviewed the logs and found that you have 2 separate apps on 'fi-us1' and 'fi-us2'. Please make sure you are using the correct host where Flex service is created. Have you tried the following?


If the above suggestion doesn't work, then I will get inputs from engineering on this issue.

Thanks,
Pranav
Kinvey

Suraj,

As a paying customer, you have access to Kinvey Support ticketing system (freshdesk). I was discussing this issue with my senior and found that you also have a dedicated slack channel. Can you please post your query on slack channel? This is Kinvey Forums - a public platform for free plan developers exploring Kinvey. Also the error which you are seeing is a Windows specific error. I also use mac and haven't seen such issue yet. It would be better if you post your question on dedicated channel or Kinvey support ticketing system. Once you post your question on dedicated channel, our team will continue to help you there.

 

Thanks,

Pranav

Kinvey

Pranav,


I tried logging the details, I do not get any errors. It always gets deployed as an FSR to a collection, but I am not able to see any output there in the collection. By output, I mean any service object getting created.


I am not into any proxies too. Is there any specific solution for this? If I use a mac, I am able to see service objects successfully using the same exact commands.


Thanks

Suraj

Suraj,

  1. Are you able to test this locally without any issues? Please check this link about local testing http://devcenter.kinvey.com/ios/guides/flexservice-runtime#TestingFlexServices
  2. Have you confirmed that you have added all the dependencies to package.json?
  3. Did you try 'Logging' to check if more information is present on the error that you are getting? Check this link for 'Logging' details - http://devcenter.kinvey.com/ios/guides/flexservice-runtime#Logging

Thanks,
Pranav
Kinvey

Hi Pranav,


Apologies to keep asking after every hurdles. I am getting something like below while deploying my Flex code,


        throw er

        ^

 

Error: EPERM: operation not permitted, scandir 'C:\Users\447299\AppData\Local\Ap

plication Data'

  at Object.fs.readdirSync (fs.js:871:18)

  at GlobSync._readdir (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-

cli\node_modules\glob\sync.js:288:41)

  at GlobSync._readdirInGlobStar (C:\Users\447299\AppData\Roaming\npm\node_modul

es\kinvey-cli\node_modules\glob\sync.js:267:20)

  at GlobSync._readdir (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-

cli\node_modules\glob\sync.js:276:17)

  at GlobSync._processReaddir (C:\Users\447299\AppData\Roaming\npm\node_modules\

kinvey-cli\node_modules\glob\sync.js:137:22)

  at GlobSync._process (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-

cli\node_modules\glob\sync.js:132:10)

  at GlobSync._processGlobStar (C:\Users\447299\AppData\Roaming\npm\node_modules

\kinvey-cli\node_modules\glob\sync.js:380:10)

  at GlobSync._process (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-

cli\node_modules\glob\sync.js:130:10)

  at GlobSync._processGlobStar (C:\Users\447299\AppData\Roaming\npm\node_modules

\kinvey-cli\node_modules\glob\sync.js:383:10)

  at GlobSync._process (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-

cli\node_modules\glob\sync.js:130:10)

  at GlobSync._processGlobStar (C:\Users\447299\AppData\Roaming\npm\node_modules

\kinvey-cli\node_modules\glob\sync.js:383:10)

  at GlobSync._process (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-

cli\node_modules\glob\sync.js:130:10)

  at new GlobSync (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\n

ode_modules\glob\sync.js:48:10)

  at Function.globSync [as sync] (C:\Users\447299\AppData\Roaming\npm\node_modul

es\kinvey-cli\node_modules\glob\sync.js:26:10)

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\ar

chiver-utils\file.js:62:17

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\ar

chiver-utils\file.js:30:19

  at Array.forEach (native)

  at processPatterns (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cl

i\node_modules\archiver-utils\file.js:24:23)

  at Object.file.expand (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey

-cli\node_modules\archiver-utils\file.js:60:17)

  at Object.file.expandMapping (C:\Users\447299\AppData\Roaming\npm\node_modules

\kinvey-cli\node_modules\archiver-utils\file.js:94:8)

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\ar

chiver-utils\file.js:159:19

  at arrayMap (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_

modules\lodash\lodash.js:660:23)

  at Function.map (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\n

ode_modules\lodash\lodash.js:9571:14)

  at interceptor (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\no

de_modules\lodash\lodash.js:16970:35)

  at thru (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modu

les\lodash\lodash.js:8812:14)

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\lo

dash\lodash.js:4379:28

  at arrayReduce (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\no

de_modules\lodash\lodash.js:704:21)

  at baseWrapperValue (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-c

li\node_modules\lodash\lodash.js:4378:14)

  at LazyWrapper.lazyValue [as value] (C:\Users\447299\AppData\Roaming\npm\node_

modules\kinvey-cli\node_modules\lodash\lodash.js:1880:16)

  at baseWrapperValue (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-c

li\node_modules\lodash\lodash.js:4376:25)

  at LodashWrapper.wrapperValue (C:\Users\447299\AppData\Roaming\npm\node_module

s\kinvey-cli\node_modules\lodash\lodash.js:9067:14)

  at Object.file.normalizeFilesArray (C:\Users\447299\AppData\Roaming\npm\node_m

odules\kinvey-cli\node_modules\archiver-utils\file.js:203:16)

  at Archiver.bulk (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\

node_modules\archiver\lib\core.js:560:25)

  at Service.deploy (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli

\lib\service.coffee:108:13)

  at Service.deploy (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli

\lib\service.coffee:1:1)

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\cmd\deploy.coff

ee:39:33

  at fn (C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_module

s\async\lib\async.js:717:34)

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\as

ync\lib\async.js:1170:16

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\as

ync\lib\async.js:172:37

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\as

ync\lib\async.js:677:43

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\as

ync\lib\async.js:173:37

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\as

ync\lib\async.js:1166:30

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\lib\service.cof

fee:181:7

  at C:\Users\447299\AppData\Roaming\npm\node_modules\kinvey-cli\node_modules\as

ync\lib\async.js:52:16

  at Immediate.<anonymous> (C:\Users\447299\AppData\Roaming\npm\node_modules\kin

vey-cli\node_modules\async\lib\async.js:1163:34)

  at runCallback (timers.js:651:20)

  at tryOnImmediate (timers.js:624:5)

  at processImmediate [as _immediateCallback] (timers.js:596:5)



Could you help me with this also?


Thanks 

Suraj

Hi Pranav,


Thank you so much for this particular answer. This saved my day.

I was initially using "kinvey config --host https://fi-us1-console.kinvey.com" and not "kinvey config --host https://fi-us1-manage.kinvey.com". I rectified this one. Will let you know if I face any other issues.


Thanks

Suraj

Answer
Suraj,

No. We don't need to give any special access in the console in order to config the Kinvey-cli locally.

I reviewed the logs and found that you have 2 separate apps on 'fi-us1' and 'fi-us2'. Please make sure you are using the correct host where Flex service is created. Have you tried the following?


If the above suggestion doesn't work, then I will get inputs from engineering on this issue.

Thanks,
Pranav
Kinvey

Pranav,


Do we need to give some special access in the kinvey console account in order to config the Kinve CLI locally? 

Suraj,

What version of kinvey-cli you are using? Please update it if you are not using the latest one.

As you are using a dedicated instance,  the 'config' command takes an optional [instance] parameter in order to deploy FlexServices to dedicated instances of Kinvey. Check https://github.com/Kinvey/kinvey-cli#proxy-settings.

Also, for more information, run "kinvey -h".

 

Thanks,

Pranav

Kinvey

Hi Pranav,


Now, I was able to login using the credentials to https://manage.kinvey.com. It asked whether I wanted to access the below,

1. apps

2. organization.


When I selected "apps", I was displayed a set of applications which I have created in https://console.kinvey.com/.

I have my Flex service in a different host URL provided by kinvey. Is there a command to access the application in that host. 


The other host URl would be from my project, something like "https://*****.console.kinvey.com/".


Regards

Suraj

Hi Pranav,


I am afraid, I am not able to login using y credentials through the command kinvey config --host https://manage.kinvey.com. It shows "warning: Invalid credentials, please authenticate". They are the credentials with which I generally login to Kinvey console.


Is there any other way that includes creating separate credentials for Kinvey CLI.


One more thing, we can access kinvey CLIs command prompt through the normal Node JS command prompt right? 


Thanks

Suraj

Suraj,

Are you able to configure Kinvey cli before deploying?
http://devcenter.kinvey.com/ios/guides/flexservice-runtime#ConfiguringtheKinveyCLI

Use following command :
kinvey config --host https://manage.kinvey.com

 


You will be prompted for your Kinvey credentials if you haven't logged in yet. These are the same credentials used when logging in to the Kinvey Console. Once you are done with configuring, try "kinvey deploy" and let me know how it goes.


Thanks,

Pranav

Kinvey

Hi Pranav,


Thanks for the prompt reply. But I have still got doubt on how to link my Node JS service code to the service Object in Kinvey FSR. The documentation does not provide information on that. What I understood so far is,


1. We need to create a service in Node JS which will be hosted in Kinvey as a collection having service type as Flex Internal Service,

2. We need to create the service object in the service linked with the Node JS service.

3. Through Kinvey CLI commands, we need to activate the Flex service, this would be deploying the code in Kinveys server.

4. Using kinvey console, we can access the code's output using GET or POST request.


I need to know how to link the service file with the Kinvey Flex service catalog. 


Thanks

Suraj

Suraj,


Regarding your issue about "Server listening to 10001 - nothing happens for GET/POST requests", have you added and installed 'request' module to package.json? I have tested the code mentioned in the Flex docs and it is working fine.



Now, regarding your question about creating a service object for a Flex service in service catalog, have you tried "kinvey deploy" command? Here is the link http://devcenter.kinvey.com/ios/guides/flexservice-runtime#DeployingFlexServices


This command deploys preconfigured NodeJS services to the FlexService Runtime and starts them. Once you do this successfully, you will be able to set a service object in service catalog.



Let me know if you come across any issues again.


Thanks,

Pranav

Kinvey

Hi there,


Could anyone tell me how to create a service object for a Flex service in service catalog of Kinvey, while creating service type for the Collections in Kinvey?


Thanks

Hi,


Also when I created a collection in Kinvey and tried to create a Flex service through service catalog. I am getting the attached error also. Please help me with this. 

FlexError.PNG
(11.9 KB)
Login or Signup to post a comment