Error accessing datastore when using apigeetool - deploynodeapp

Not applicable

I'm new to Apigee, so I hope this isn't a silly question... I'd like to upload a pre-existing Node project into Apigee using the 'apigeetool'; my understanding is that before uploading I must run 'npm install' in order to build all dependencies. Using the 'deploynodeapp' function in a similar manor to this:

apigeetool deploynodeapp -n <some name> -d <path to root of node project> -o <organisation> -e qa -b <path> -u <email> -m <root js file>
This gives the following error:
"message" : "com.apigee.datastore.DataAccessException{ code = datastore.ErrorWhileAccessingDataStore, message = Error while accessing datastore;Please retry later, associated contexts = []}"

Now I believe that this is due to exceeding some sort of package size issue, 15mb?, which I have seen loosely coupled with the error I'm seeing. Looking at the project size I can see that node_modules is far greater than 15mb. Removing the node_modules directory, as a test, and then uploading the node project is successful (and a total size of <1mb). So my question is, can this limit be changed? and if so how does one go about doing this?

Thanks

0 6 678
6 REPLIES 6

@alex.tylor , Great Question, Welcome to Apigee Community. I have asked experts to answer same. Stay tuned.

@alex.tylor , You can also try to push the node application without installing dependencies & later install same using Apigee Edge API. You can find more about API here.

PS: I am not sure whether it works but worth to give a try.

Hi @alex.tylor,

what you have done is right,

> remove the node_modules and upload your proxy first

then,

> you can use this API to install the node modules dependencies

http://apigee.com/docs/management/apis/post/organi...

Thanks,

Not applicable

Thanks you @Mukundha Madhavan and @Anil Sagar, going through that has proven useful, I think that I got slightly confused with uploading a node instance as a proxy and the node_module directory up as a zip, over uploading a standalone node project using apigeetool... So using the curl command and passing in 'install' as the desired npm action using:

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Authorization: Basic <basic auth header value>==" -d "command=install" "https://api.enterprise.apigee.com/v1/organizations/<org>/apis/<some name>/revisions/9/npm?verbose=true"

This doesn't seem to work; using the curl example above it gives no feedback (even with verbose set as true); and when I make the same call via the webpage link provided I simply get:

An internal error has occurred. Please retry your request.

Which seems to be shown on both the request and response tab.

I realised that a package that is globally installed was not in the pacakge.json so having updated this, re-uploaded the node project and then tried the 'npm install' via both the curl and provided webpage link. Unfortunately this fails and returns no feedback; is there a way to see why it is failing? Thanks

Not applicable

Even your bundle seems pretty large due to all NPM modules required, you can make apigeetool to upload these modules separately, so the actual size of your bundle is reduced, hence it can be uploaded with a smaller footprint. My suggestion in such case is to still leverage apigeetool and let apigeetool upload the modules for you. The flag -U will deploy it in this fashion. The deployment command will similar to this:

apigeetool deploynodeapp -n <some name> -d <path to root of node project> -o <organisation> -e qa -b <path> -u <email> -m <root js file> -U

Let us know your findings!

Not applicable

With the '-U' switch the apigeetool is able to deploy the application without removing the 'node_modules' directory prior, however I'm not seeing the 'node_manager' directory available within the Apigee proxy editor.