Staging Error while Pushing a Spring Application to Cloud Foundry - spring

I am getting the following Error while pushing the Sample Hello World spring application on CloudFoundry.
Using manifest file C:\Users\I321571\Desktop\helo\Hello\manifest.yml
Updating app Hello in org trial / space I321571 as I321571...
OK
Uploading Hello...
Uploading app files from: C:\Users\I321571\Desktop\helo\Hello
Uploading 20.1K, 46 files
Done uploading
OK
Stopping app Hello in org trial / space I321571 as I321571...
OK
Starting app Hello in org trial / space I321571 as I321571...
-----> Downloaded app package (12K)
Cloning into '/tmp/buildpacks/java-buildpack'...
-----> Java Buildpack Version: b050954 | https://github.com/cloudfoundry/java-buildpack.git#b050954
[Buildpack] ERROR Compile failed with exception #<RuntimeError: No container can run this application. Please ensure that you've pushed a valid JVM artifact or artifacts using the
-p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
No container can run this application. Please ensure that you've pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifac
ts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation.
Staging failed: Buildpack compilation step failed
FAILED
Error restarting application: BuildpackCompileFailed
TIP: use 'cf logs Hello --recent' for more information
this is my manifest.yml
applications:
- name: Hello
memory: 512M
instances: 1
Please help me in resolving the issue.

I encountered this error too!
Make sure the command given is valid
cf push {your-app-name} -p {path to your executable jar}

Related

Spring Boot app in Docker container not starting in Cloud Run after building successfully - cannot access jarfile

I've set up continuous deployment to Cloud Run from GitHub for my Spring Boot project, and while it's successfully building in Cloud Build, when I go over to Cloud Run, I get the following error under Creating Revision:
The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable.
When I go over to the Logs, I see the following errors:
2022-09-23 09:42:47.881 BST
Error: Unable to access jarfile /app/target/educity-manager-0.0.1-SNAPSHOT.jar
{
insertId: "632d7187000d739d29eb84ad"
labels: {5}
logName: "projects/educity-manager/logs/run.googleapis.com%2Fstderr"
receiveTimestamp: "2022-09-23T08:42:47.883252595Z"
resource: {2}
textPayload: "Error: Unable to access jarfile /app/target/educity-manager-0.0.1-SNAPSHOT.jar"
timestamp: "2022-09-23T08:42:47.881565Z"
}
2022-09-23 09:43:48.800 BST
run.googleapis.com
…ager/revisions/educity-manager-00011-fod
Ready condition status changed to False for Revision educity-manager-00011-fod with message: Deploying Revision.
{
insertId: "w6ptr6d20ve"
logName: "projects/educity-manager/logs/cloudaudit.googleapis.com%2Fsystem_event"
protoPayload: {
#type: "type.googleapis.com/google.cloud.audit.AuditLog"
resourceName: "namespaces/educity-manager/revisions/educity-manager-00011-fod"
response: {6}
serviceName: "run.googleapis.com"
status: {2}}
receiveTimestamp: "2022-09-23T08:43:49.631015104Z"
resource: {2}
severity: "ERROR"
timestamp: "2022-09-23T08:43:48.800371Z"
}
Dockerfile is as follows (and looking at the build log all of the commands in it completed successfully):
FROM openjdk:17-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
COPY . /app
ENTRYPOINT [ "java","-jar","/app/target/educity-manager-0.0.1-SNAPSHOT.jar" ]
I've read that Cloud Run defaults to exposing Port 8080, but just to be on the safe side I've put server.port=${PORT:8080} in my application.properties file (but it seems to make no difference one way or the other).
I have run into similar issues in the past. Usually, I am able to resolve this issue by:
specifying the port in the application itself (as you indicated in your post), and
exposing the required port in my dockerfile eg. EXPOSE 8080
Oh my good god I have done it. After two full days of digging, I realised that because I was doing it through github, my .gitignore file was excluding the /target folder containing the jar file, so Cloud Build never got the jar file mentioned in the Dockerfile.
I am going to have a cry and then go to the pub.

How to deploy GoLang Binaries to CF

Hi we are trying to deploy golang binaries to cf.
for example main.exe which is in /deploy/ folder along with mainfest file
Note: It is also observed that if we push the whole project app then it works. but if we try to push only binaries then we get the below error
And Manifest file contains following info
applications:
- name: test-app
command: test-app
env:
GO_INSTALL_PACKAGE_SPEC: ./
**ERROR** To use go native vendoring set the $GOPACKAGENAME
environment variable to your app's package name
**ERROR** Unable to determine import path: GOPACKAGENAME unset
After adding GOPACKAGENAME: main since main.exe is our binary name we get following error below
Failed to compile droplet: Failed to run finalize script: exit status 12
Cell 507b6e9c-c5c5-4685-9a71-d7cc1c876f5a stopping instance 6a92ff73-76ec-4baf-8a3e-54b54cfa307e
BuildpackCompileFailed - App staging failed in the buildpack compile phase
thanks #Volker for pointing out
for above issue:
first we have to build with following command (used make file)
GOOS="linux" go build main.go
then copy that main binary to /deploy folder
then manifest file in the deploy folder
applications:
- name: test-app
command: ./main
stack: cflinuxfs3
buildpacks:
- https://github.com/cloudfoundry/binary-buildpack.git
Then to push to cf
cf push -f ./manifest-template.yml

Drools Workbench Non-readable POM

I'm trying to use drools workbench to create rules, the following commands have been executed to pull the docker image and run a container:
docker pull jboss/drools-workbench-showcase
docker run -p 8080:8080 -p 8001:8001 -d --name drools-workbench jboss/drools-workbench-showcase:latest
The drools workbench gets up and running as expected, however, when I try to add project, Non-readable POM error shows up:
drools workbench error log:
2019-05-27 01:38:03,688 ERROR [org.appformer.maven.integration.MavenRepository] (EJB default - 1) Error while trying to
erase directory from local maven repository /opt/jboss/.m2/repository/org/kie/kie-api/7.18.0.Final
2019-05-27 01:38:03,689 ERROR [org.appformer.maven.integration.MavenRepository] (default task-8) Error while trying to e
rase directory from local maven repository /opt/jboss/.m2/repository/org/kie/kie-api/7.18.0.Final
2019-05-27 01:38:03,694 ERROR [org.appformer.maven.integration.embedder.MavenProjectLoader] (Thread-241) Unable to creat
e MavenProject from InputStream: org.apache.maven.project.ProjectBuildingException: 1 problem was encountered while buil
ding the effective model
[FATAL] Non-readable POM : input contained no data #
for project
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:168)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:126)
at org.appformer.maven.integration.embedder.MavenEmbedder.readProject(MavenEmbedder.java:308)
at org.appformer.maven.integration.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:91)
at org.appformer.maven.integration.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:84)
at org.appformer.maven.integration.MavenPomModelGenerator.parse(MavenPomModelGenerator.java:34)
at org.appformer.maven.support.PomModel$Parser.parse(PomModel.java:110)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildPomModel(KieBuilderImpl.java:534)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.getPomModel(KieBuilderImpl.java:511)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.init(KieBuilderImpl.java:152)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:211)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:203)
at org.kie.workbench.common.services.backend.builder.core.Builder.build(Builder.java:213)
at org.kie.workbench.common.services.backend.builder.core.BuildHelper.build(BuildHelper.java:92)
My OS is Windows 10, and the Drools Workbench version is 7.18.Final, have I missed any configuration? I checked the official guide and searched the web, but haven't found solution yet.

How to deploy golang application on gcloud

Hi i am trying to deploy a golang application on gcloud using command on ubuntu:-
gcloud app deploy app.yaml index.yaml
But i am getting an error as follow:-
ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed: /work_dir/github.com/stretchr/testify/assert/assertions.go:17: can't find import: "github.com/davecgh/go-spew/spew" 2018/01/02 04:59:26 go-app-builder: build timing: 23×compile (14.75s total), 0×link (0s total) 2018/01/02 04:59:26 go-app-builder: failed running compile: exit status 2
I have installed all the dependencies and packages please help me thanx in advance :)
gcloud is broken: https://issuetracker.google.com/issues/38449183 try to use goapp.

compiling error when using community golang buildpack on bluemix

One of my bluemix application worked for weeks but it start to report parse error with Buildpack compilation step failed when pushing app to bluemix:
-----> Downloaded app package (556K)
Cloning into '/tmp/buildpacks/buildpack-go'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'f752ecf4b27d2f31bb082dfe7a47c76fefc769d7'
-------> Buildpack version 1.4.0
parse error: Expected separator between values at line 32, column 3
Staging failed: Buildpack compilation step failed
Here's my manifest.yml file:
---
applications:
- name: joystick
memory: 128M
path: .
buildpack: https://github.com/cloudfoundry/buildpack-go.git
Update: I carefully read the error message and figured out it is application space problem caused by Godeps.json parsing error caused by code merging where one comma is missed. I can not reproduce this locally because I checked in _workspace directory where it never parse Godeps.json.
I created issue 86 to improve this buildpack to provide more information for such kind of error message.
The error message parse error: Expected separator between values at line 32, column 3 comes from jq command within buildpack code, where it tries to read import path from Godeps/Godeps.json by assuming it's a valid JSON file. see line #64 of /bin/compile.
It will stop buildpack if the Godeps.json is not json.
I created issue 86 to improve this buildpack to provide more information for such kind of error message.
Thanks for everyone who spent time on this problem.
Update: issue 86 was fixed in heroku golang buildpack by adding new step to checking Godeps.json format.

Resources