I have developed a standalone application using Java7 and Spring. When I deploy the application on CloudFoundry everything works fine at the beginning. When I run mvn cf:apps I see all apps have the status STARTED. However after some hours it seems the app crashes, its status is still STARTED but when I try to retrieve the logs I get the following error:
[ERROR] Failed to execute goal org.cloudfoundry:cf-maven-plugin:1.0.0.M4:logs (default-cli) on project [....]: An exception was caught while executing Mojo. 500 Internal Server Error -> [Help 1]
When I redeploy the application, it works again, but only for some time. I also noticed the following phenomen, when I check the deployed apps with the VMC tool instead of Maven, then the standalone apps do not show as running, but instead their status is 0%:
name status usage runtime url
standaloneapp1 0% 2 x 512M java7 standaloneapp1.cloudfoundry.com
standaloneapp2 0% 1 x 512M java7 standaloneapp2.cloudfoundry.com
webapp running 1 x 512M java7 webapp.cloudfoundry.com
I have the following questions:
Is it normal that the VMC tools shows standalone apps status as 0%?
How can I get more information about my applications, to find out what goes wrong?
P.S: My standalone apps seem to require quite a lot of RAM, when I ran the standalone apps with 128MB or 256MB then I always got out of memory errors. When I run the apps locally they do not need that much ram, both apps only have a small main method and some beans for RabbitMQ and MongoDB. I'm not sure if this problem is related though.
To get more information about your apps, use the "vmc logs " command.
However, Cloud Foundry v1 is going away after Jun 30th so you may want to consider migrating your apps to v2 running at run.pivotal.io (new docs at docs.cloudfoundry.com).
Related
All of a sudden I cannot get GCP local cloud builds running.
I've tried updating the to the latest version of the various pieces
Docker Desktop 2.5.01 Engine 19.03.13
Google Cloud SDK 317.0.0
cloud-build-local 0.5.2
And I have done all possible Windows updates for my current build 2004(19041.572)
If I do a dry run, all is successful and there are no issues.
When I do a full run, a busybox container fires up, status changes to EXITED (0), and that where it all just stops.
Terminal output below
cloud-build-local --config=cloudbuild-hosting-prod.yaml
--dryrun=false . 2020/11/10 15:12:44 Warning: The server docker version installed (19.03.13) is different from the one used in GCB
(19.03.8) 2020/11/10 15:12:44 Warning: The client docker version
installed (19.03.13) is different from the one used in GCB (19.03.8)
A colleague of mine is having the same issue, yet if I run the same build on my laptop, all works fine, so its not the YAML file (which hasn't changed anyway) or a code issue
Docker Desktop 2.5.0.0 Engine 19.03.13
Google Cloud SDK 301.0.0
cloud-build-local
Any advice on how to troubleshoot what the issue could be.
We developed a Flask webapp, and want to deploy it on IIS. During development, we started the app via flask run, which lanches a single instance of our app. On IIS, however, we observed (via the task manager) that our app runs multiple instances concurrently.
The problem is that our app is not designed to run in parallel. For example, our app reads a file from the file system and keeps it in memory for efficiency. This optimization is correct only if it is guaranteed that no other process changes the content of the file.
Is there a way to prevent IIS from starting multiple instances?
In IIS, you can go to FastCGI settings, in there you can see all the applications used by websites on your server. In the column "Max. Instances", the script you are talking about is probably set to 0 (or some value greater than 1), meaning it can be started multiple times. Limiting this to 1 will solve your problem.
you could use below code to run only one instance of a program:
from tendo import singleton
me = singleton.SingleInstance() # will sys.exit(-1) if other instance is running
the command to install:
pip install tendo
Reference link:
Check to see if python script is running
How to make only one instance of the same script running at any time
https://github.com/pycontribs/tendo/blob/master/tendo/singleton.py
My current set up has a Django project running on Windows 2016 IIS.
The project is hosted on GitHub for collaboration and I would like to set up a GitHub webhook so whenever there's a push to master branch from any of the collaborators, the IIS Server will run a "git pull" to update the project on the server.
What is normally the setup for this?
What I have tried so far is to create an endpoint in the Django project, this endpoint whenever called will run Python subprocess to run "git pull" command in the project itself. However, whenever I run it, it get a 500 response from IIS.
Thanks #VonC for helping.
I have looked to the log (which was the one in XML) but it wasn't much help.
What I'm posting here was my workaround, not exactly to the answer for the question above.
I used django-background-tasks to add the command subprocess.run(['git', 'pull']) as a task to run later (after a few seconds after that by the #background decorator).
Error 500 means the IIS server throws an error.
You need to check said IIS server logs in order to check at what point in the execution of the webhook endpoint script the error occurs.
I'm trying to set up my Meteor apps on AWS EB and I've successfully deployed 2. Weird thing is one of them is using 30% CPU when idle, as opposed to 0.3% on the other one.
Both are running METEOR#1.4.2.3, both are on t2.large EC2 instances. I previously had the apps on Galaxy without any issues (have to make the switch because we got a generous amount of credits from AWS)
The only difference is the app that's idle at 30% has Meteor settings be loaded on startup and the other one doesn't use any Meteor settings since it's just used to connect to the DB and display info (as a microservice)
Are you issuing this
meteor build --server ${ROOT_URL} --verbose --directory ${BUILD_NODEJS_DIR} --mobile-settings build/${SETTINGS_JSON_FILE}
to bundle your code ready for deployment ... then over on your cloud provider are you executing your meteor app by calling
node main.js
This adheres to current meteor standards of deployment ( version 1.4.2.3 ) ... which I am using to deploy a meteor app onto AWS EC2 and see no high CPU usage when its idle
Silly me, was using Node version 6+ that isn't supported by Meteor fully yet, switching to 4.6.1 did the trick.
I'm a Jetty newb, but it's making life hell. First there was an Eclipse problem I described in another question. Rather than waste time on it, I decided to just run Jetty from the console. I started off importing a sample Tapestry project and was able to run it fine... the project is on the Tapestry page and is called tutorial1
I began work on my own project then and began introducing new functionality to it. At some point it stopped working. I tried backtracking my project to get it to a working state but every time I requested the home page it would just hang. At this point I still thought it was my fault, though I did think a more graceful error message would have been nice than the it attempting to load for a minute followed by a server timeout error.
I then shutdown jetty and attempted to load up the imported sample project using mvn jetty:run in my tutorial1 project directory. it doesn't work either! When I try going to localhost:8080/tutorial1 or the URL of my project the jetty console does show any output, almost as if it's not receiving the request.
I rebooted my entire machine but that doesn't help. I am not familiar with jetty architecture and am unsure if there is a way I can purge all my files from the jetty web application directory.
Any ideas?
Cliffs Notes:
Downloaded Tapestry Archetype project with maven.
Executed jetty from the command line using mvn jetty:run
Started new project
Executed jetty from the command line using mvn jetty:run
Modified new project
Error occurred, attempted fix and restarted Jetty (Ctrl + C, followed by mvn jetty:run)
Jetty restarted, but did not seem to handle requests for any pages
Tried starting jetty from Archetype project, experienced the same problem
If your project didn't deploy correctly, jetty won't serve any pages (they will either return 404 or some error in the 500s).
Look at the log folder and check if it is getting correctly deployed.