Closed ericqqqqq closed 5 years ago
👋 @ericqqqqq
Sorry to hear you are having issues. Can you answering me the following questions...
If you are hitting intermittant platform issues - I can ask the platform team to investigate. If you are hitting some rate limiting errors - I can look at introducing a different approach to deploying huge amounts of actions to try and resolve it.
@jthomas Hi, I want to apologize for my late reply first.
Answer to questions:
I'm deploying on us-south
.
I'm deploying 24 actions in total (more in the future). I am working on a team project, it may be not a good idea to share my raw YAML. However, I can provide some informations and structures of my YAML.
provider: name: openwhisk runtime: nodejs:10
custom:
resources: packages:
functions:
myAction: name: "packageName/actionName" handler: myHandlerLocation parameters: myDefaultParameter: myValue plugins:
👋@jthomas
Do you have any updates on this issue?
I'm been testing out a similiar size project to the above but can't replicate the error I'm afraid (in the London region). Here's the test files I'm using - can you try them out and see if you are still having that issue?
service: too-large
provider:
name: openwhisk
runtime: nodejs:10
functions:
hello_0:
handler: handler.hello
...
hello_24:
handler: handler.hello
plugins:
- serverless-openwhisk
{
"name": "too-large",
"version": "1.0.0",
"description": "Sample OpenWhisk NodeJS serverless framework service.",
"main": "handler.js",
"keywords": [
"serverless",
"openwhisk"
],
"devDependencies": {
"serverless-openwhisk": ">=0.13.0"
},
"dependencies": {
"mocha": "^6.1.2",
"sentiment": "^5.0.1"
}
}
'use strict';
const Sentiment = require('sentiment');
function hello(params) {
const sentiment = new Sentiment()
const result = sentiment.analyze(params.message || 'Cats are stupid.');
return { result };
}
exports.hello = hello;
I could guess since each function deployment in the configuration is sent as a parallel request this might be rejected by the platform due to rate limiting. One solution would be to modify the line here: https://github.com/serverless/serverless-openwhisk/blob/master/deploy/lib/deployFunctions.js#L42-L43
...to use Bluebird Promise libraries map
function which has a concurrency
option which could be set to 1 or a low number to ensure not too many requests are being sent at once.
Could you test this out in your project and let me know if that works? If so, we can turn it into a PR and merge back upstream.
Hi @jthomas Thanks for the help, to be honest, this error happens randomly and it is unpredictable here😔. It is not happening to me every single time. Weird thing is after I opened an issue here, I have not seen the same error again.
Since I am using openwhisk serverless almost every day. I will test with your solution if it happens again. I will 100% let you know how it works.
@ericqqqqq If this is happening on IBM Cloud, feel free to open a support ticket to get them to look into it!
Closing due to lack of activity on this issue...
I am currently using serverless.yml to deploy my actions to IBM Cloud. Now, I guess because of the large amount of actions I have to deploy every time, I am hitting 502 gateway too often.
The way I solve 502 issue so far is to deploy the first half of my actions first, and then deploy the rest of actions. I found this process is tedious and annoying. Now, I am thinking is there any way to manage these actions in several
serverless.yml
(eg, my first half goes to serverless1.yml, and my second half goes to serverless2.yml)So that, I can automate my way to solve 502 gateway error. Alternatively, I am happy to hear any other better way to get rid of 502 gateway error.
Error: