Cloudfoundry Error 310 : Staging failed : Staging plugin failed - cloud-foundry

CFoundry::AppStagingError: 310: Staging failed: 'Staging task failed:
Staging plugin failed: /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/
vcap_staging-0.1.63/lib/vcap/staging/plugin/java_web/plugin.rb:28:in block in s
tage_application': Web application staging failed: web.xml not found (RuntimeErr
or)
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_stagin
g-0.1.63/lib/vcap/staging/plugin/java_web/plugin.rb:22:inchdir'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_stagin
g-0.1.63/lib/vcap/staging/plugin/java_web/plugin.rb:22:in stage_application'
from /var/vcap/packages/stager/bin/run_plugin:19:in'
'
For more information, see ~/.vmc/crash
This is the error i'm getting whenever i run the vmc push command when trying to deploy any java files or .war files in windows. After running this command, i can see that the file is uploaded on the cloud but it never runs correctly. I experience almost the same error when i try to run through java/spring or any other framework.
Someone please help me with this issue.

Related

Unable to automatically deploy a dotnet app to Elastic Beanstalk

I’m trying to deploy a test application to EB. I’m running into an issue. I followed this tutorial: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/dotnet-linux-core-tutorial.html
When I upload the test application, it fails to start. /var/log/eb-engine.log says
2022/02/07 21:59:18.585543 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForDotNetCoreApplication]. Stop running the command. Error: err
or stat /var/app/staging/dotnet-core-tutorial: no such file or directory with file /var/app/staging/dotnet-core-tutorial
So I changed the parent directory in my source bundle so that it exported into /var/app/staging/dotnet-core-tutorial instead of /var/app/staging. Now I get this error
2022/02/07 22:29:51.468918 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForDotNetCoreApplication]. Stop running the command. Error: the
re is no .runtimeconfig.json file for your single application. Please provide a valid application
I confirmed that the source bundle does have a .runtimeconfig.json file.
The .runtimeconfig.json file is generated when you run the dotnet publish -o site command, so check if this command is running properly for you.
If you take a look on the tutorial, section "To create a source bundle" you have this file, so check the steps that you already did.
Also if you want to force this file to be generated you can add set
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> directly, but this is normally needed when you are not creating executable files like class libraries.

Logstash Google Pubsub Input Plugin fails to load file and pull messages

I'm getting this error when trying to run Logstash pipeline with a configuration that is using google_pubsub on a docker container running in my production env:
2021-09-16 19:13:25 FATAL runner:135 - The given configuration is invalid. Reason: Unable to configure plugins: (PluginLoadingError) Couldn't find any input plugin named 'google_pubsub'. Are you sure this is correct? Trying to load the google_pubsub input plugin resulted in this error: Problems loading the requested plugin named google_pubsub of type input. Error: RuntimeError
you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with `lock_jars` command
no such file to load -- com/google/cloud/google-cloud-pubsub/1.37.1/google-cloud-pubsub-1.37.1 (LoadError)
2021-09-16 19:13:25 ERROR Logstash:96 - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
This seems to randomly happen when re-installing the plugin. I thought it's a proxy issue but I have the google domain enabled in the whitelist. Might be the wrong one / missing something. Still, doesn't explain the random failures.
Also, when I run the pipeline in my machine I get GCP events, but when I do it on a VM - no Pubsub messages are being pulled. Could it be a firewall rule blocking them?
The error message suggests there is a problem in loading the ‘google_pubsub’ input plugin. This error generally occurs when the input Pub/Sub plugin is not installed properly. Kindly ensure that you are installing the Logstash Plugin for Pub/Sub correctly.
For example, installing Logstash Plugin for Pub/Sub in a VM :
sudo -u root sudo -u logstash bin/logstash-plugin install logstash-input-google_pubsub
For a detailed demo refer to this community tutorial.

Deployment of dotnet core application fails in Elastic Beanstalk

I have created Elastic Beanstalk using Cloudformation template and deploying a dotnet core application in it. While trying to deploy it, the deployment was failing and it shows the below issues:
Inside my environments in Beanstalk im seeing below error:
Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
[Instance: i-0d2a1ee08dc2813ff ConfigSet: Infra-EmbeddedPreBuild, Hook-PostInit, Hook-PreAppDeploy, Infra-EmbeddedPostBuild, Hook-EnactAppDeploy, Hook-PostAppDeploy, Infra-WriteVersionOnStartup] Command failed on instance. Return code: 1 Output: null.
The Health status is showing severe and if I visit the causes, im getting the below error:
Application deployment failed at 2021-08-19T05:36:34Z with exit status 1 and error: .
Process default has been unhealthy for 19 minutes (Target.FailedHealthChecks).
In Cloudwatch log groups, the deployment log shows the below deployment failure:
AWSBeanstalkCfnDeploy.DeploymentUtils - Unexpected Exception: System.Exception: Exception during deployment. ---> Microsoft.Web.Deployment.DeploymentDetailedException: Object of type 'package' and path 'C:\cfn\ebdata\source_bundle_final.zip' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT. ---> Microsoft.Web.Deployment.DeploymentException: The Zip package 'C:\cfn\ebdata\source_bundle_final.zip' could not be loaded. ---> System.IO.FileNotFoundException: Could not find file 'C:\cfn\ebdata\source_bundle_final.zip'
INFO 1 AWSBeanstalkCfnDeployApp.DeployApp - Event [ERROR]: Deployment Failed: Unexpected Exception
I am using Solution stack as "64 bit windows server 2019 v2.6.8 running IIS 10.0", not sure if that is causing the issue. Can someone provide your inputs on the deployment part on what could could be the issue ? Thanks!

AWS: ERROR: Pre-processing of application version xxx has failed and Some application versions failed to process. Unable to continue deployment

Hi I am trying to deploy a node application from cloud 9 to ELB but I keep getting the below error.
Starting environment deployment via CodeCommit
--- Waiting for Application Versions to be pre-processed --- ERROR: Pre-processing of application version app-491a-200623_151654 has
failed. ERROR: Some application versions failed to process. Unable to
continue deployment.
I have attached an image of the IAM roles that I have. Any solutions?
Go to your console and open up your elastic beanstalk console. Go to both applications and environments and delete them. Then in your terminal hit
eb init #Follow instructions
eb create --single ##Follow instructions.
It would fix the error, which is due to some application states which are failed. If you want to check those do
aws elasticbeanstalk describe-application-versions
I was searching for this answer as a result of watching a YouTube tutorial for how to pass the AWS Certified Developer Associate exam. If anyone else gets this error as a result of that tutorial, delete the 002_node_command.config file created in the tutorial and commit that change, as that is causing the error to occur.
A failure within the pre-processing phase, may be caused by an invalid manifest, configuration or .ebextensions file.
If you deploy an (invalid) application version using eb deploy and you enable the preprocess option, The details of the error will not be revealed.
You can remove the --process flag and enable the verbose option to improve error output.
in my case I deploy using this command:
eb deploy -l "XXX" -p
And can return a failure when I mess around with .ebextensions:
ERROR: Pre-processing of application version xxx has failed.
ERROR: Some application versions failed to process. Unable to continue deployment.
With that result I can't figure up what is wrong,
but deploying without -p (or --process)and adding -v (verbose) flag:
eb deploy -l "$deployname" -v
It returns something more useful:
Uploading: [##################################################] 100% Done...
INFO: Creating AppVersion xxx
ERROR: InvalidParameterValueError - The configuration file .ebextensions/16-my_custom_config_file.config in application version xxx contains invalid YAML or JSON.
YAML exception: Invalid Yaml: while scanning a simple key
in 'reader', line 6, column 1:
(... details of the error ...)
, JSON exception: Invalid JSON: Unexpected character (#) at position 0.. Update the configuration file.
Now I can fix the problem.

Failed to stage application, with error code 170001

App deployment into Pivotal Cloud Foundry is failing. Find below staging error log. I am guessing download of buildpack could be failing.
log of 'cf push' command:
Creating app gs-serving-web-content in org DEV / space Project-1 as abc.xyz...
OK
Creating route gs-serving-web-content.cf.myorg.com...
OK
Binding gs-serving-web-content.cf.myorg.com to gs-serving-web-content...
OK
Uploading gs-serving-web-content...
Uploading app files from: gs-serving-web-content-0.1.0.jar
Uploading 546.7K, 89 files
Done uploading
OK
Starting app gs-serving-web-content in org DEV / space Project-1 as abc.xyz...
FAILED
Server error, status code: 400, error code: 170001, message: Staging error: failed to stage application:
Error downloading: Response status: unknown, Error: Errno::ECONNREFUSED
Try to check if enough stagers are there. I believe its a memory issue. just try to increase memory in you cf instance.