I am trying to download my app source developed on IBM Bluemix using bx cf download command, but I am simply getting a message saying Files downloaded: 0/
Here's the command I am giving
Here's my app listed
The command creates a folder named Bluemix in C:\Bluemix directory, but it's empty.
Info -
It is a Node JS based app using Watson Conversation API.
Can any one help me resolve the issue?
The cf download hasn't been viable since the architecture moved to Diego. If it's just a couple of files, you can take advantage of bx cf ssh and use cat like:
bx cf ssh "myApp" -c "/bin/cat /home/vcap/app/mongostorage.js" > mongostorage.js
But to get them all, the easiest way to achieve this is to go to your Bluemix dashboard and in your app, bottom right, add continuous delivery. That will give you a Git repo you can git clone from and look at online. This is best if you intend on doing any edits.
It is also possible to get them all using ssh. See How to copy files from Liberty on Bluemix to Windows?
Related
Since today I have the problem that the CF push task in bamboo will hang on the Uploading app files step. I didn't change anything besides some environment variables and of course a bit of code. The log looks like this:
Creating/updating app App-X...
Uploading App-X... Uploading app files
from: /home/bamboo/bamboo-agent-home/xml-data/build-dir/App-X-JOB1/
This will run forever without the Application Cloud getting any updates.
Are there any good ways to debug CF push tasks?
You should try to debug your deployment as close as possible to the way you execute it on bamboo. If you do a cf push, the cf cli automatically tails the staging logs for you, so if you don't see any output during staging it's unlikely that cf logs will tell you anything more.
Since the last thing you're seeing from the log snippet posted above is an "uploading" statement, I would check these things:
use a more recent version of the cf cli, they recently added an upload progress bar which might be useful
check if you have either a .gitignore or .cfignore file in the dir you're pushing from so that you don't push any files you don't need (docs)
hanging pushes may be a plain malfunction of the CF platform you're using, e.g. due to inavailability of CFs internal blob store, no more cells available for staging etc., there's tons of possibilites here
Disclaimer: I'm a co-founder at Meshcloud and we provide public and private (also on-site/hybrid) managed Cloud Foundry hosting in the EU.
You can get the full trace log of a push by using cf push -v, which might give you a hint of where (and possibly why) it is stuck.
Other useful debugging tools are cf logs / cf logs --recent and cf events, but if the push itself simply hangs (rather than failing), they might not produce anything at all. Have you tried waiting for the timeout?
Also, please make sure you're using the latest cf cli version.
I am trying to push app to cloud foundry from Jenkins. And it complains of this :
org.cloudfoundry.client.v2.ClientV2Exception: CF-AppResourcesFileModeInvalid(160003): The resource file mode is invalid: File mode '444' with path '.git/objects/pack/pack-af4cdbe6faac9d245253dafc1ecae06dc3fa5816.pack' is invalid. Minimum file mode is '0600'
at org.cloudfoundry.util.JobUtils.getError(JobUtils.java:81)
at reactor.core.publisher.MonoThenMap$ThenMapMain.onNext(MonoThenMap.java:120)
at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:96)
I have tried:
1.Doing chmod 666 ( and even 777) before the build step.
2.Adding these in my .cfignore:
scripts
.git/
.git/objects/pack/*
plugins/**/*
/.bundle
tmp/
.pack
Wiping off workspace in jenkins and app on cf before another try.
Nothing works.
One interesting thing is after a fresh commit to .cfignore (editing a line and pushing to git) , the first build in jenkins works. Subsequent build fails.
Any help?
Thanks!
The root issue is that the Cloud Foundry Java Client pushes the entire content of the configured path to the server. The Cloud Foundry CLI automatically filters out source control directories (and possibly all hidden directories) this filtering out the most common places to see < 0600, but that’s not actually documented anywhere so we don’t match that behavior. I’ve chatted with the lead of the CLI and they’ll document that behavior at which point we’ll implement what they spec.
The .cfignore file does’t work in the client yet either, but once that is properly spec’d by the CLI team, we’d work that issue as well.
There is option to push the application from git URL or any URL
using the CF Client (I mean via code) ?
Here there is documentation how to push from path
http://cli.cloudfoundry.org/en-US/cf/push.html
Neither the cf CLI, nor the Java client, nor the Cloud Controller API currently accept a git URL (or any other URL) to download the application bits into Cloud Foundry.
The --path option on cf push only accepts paths on your local filesystem.
If we were to support this (the topic has come up once or twice), it may make most sense for the Cloud Controller to expose an API for it, so that it can be supported by all CF clients in the same way. With this approach, CF can also be smarter about updates: it can check the git sha to know whether new bits need to be downloaded.
An issue with the current APIs for the CLI is that the CLI would first need to download the app bits from the URL and then upload it to CF, which seems inefficient. It would not be any faster than git clone https://github.com/example/app && cf push myapp -p app (apart from saving you a handful of keystrokes).
As far as I am aware cf client does not support direct deployment via code relying on CI/CD systems for this.
Some helpful links for research and discuss it:
Project manager/lead for CF CLI project - Dies Köper
( https://www.cloudfoundry.org/projects/ -> CLI )
#cli on cloudfoundry.slack.com
Tracker on https://www.pivotaltracker.com/n/projects/892938
I've created a liberty bluemix project. Then bluemix created the GIT project. I've downloaded it in eclipse and now I want to enable more features.
There's a server.xml there
but no matter what features I add there, bluemix logs says I am still using the default ones.
I am just pushing the changes to GIT (so jazz will push them to bluemix)
What am I doing wrong?
From my understanding the server.xml from the starter is for your local Liberty runtime that you can also fire up from within the maven plugin. If you want to make changes to your bluemix Liberty feature set you can do so by setting cf environment variables.
See my recent blogpost on how I did this.
https://bluemixdev.wordpress.com/2016/02/07/bootstrap-a-websphere-liberty-webapp/
I added the following to the build script in my deployment pipeline.
cf set-env blueair-web JBP_CONFIG_LIBERTY “app_archive: {features: [servlet-3.1]}”
cf push “${CF_APP}”
Alternatively you can set the liberty feature set within your manifest, see this blogpost on how to do so: https://bluemixdev.wordpress.com/2016/02/21/specify-liberty-app-featureset-in-manifest/
If all you're trying to do is update the feature list, then setting the JBP_CONFIG_LIBERTY is the easiest way.
But if you're looking to provide more config in the server.xml then you'll need to provide a server package.
For example, for this case:
I can either:
I can issue a cf push myBluemixApp directly from the "videoServer" directory.
Or, package the server using the wlp/binserver package videoServer --include=usr command and then push the resulting zip file cf push myBluemixApp -p wlp/usr/servers/videoServer/videoServer.zip https://developer.ibm.com/bluemix/2015/01/06/modify-liberty-server-xml-configurations-ibm-bluemix/
Or, manually or using your build, create a wlp dir structure keeping only the files you want to upload as I've done in the deploy directory here: https://hub.jazz.net/project/rvennam/Microservices_Shipping/overview You can then push that directory as I'm doing (see manifest.yml). This will work with jazz/DevOps Services.
Packaging the server.xml within a war file is not the correct way.
I am using Azure Mobile Services as the backend for my mobile app. Despite my best efforts, my server side scripts are getting complex now. Is there a way I can keep the insert, update, read, delete scripts for the tables in my service, in source control and maybe have a way to deploy them from within Visual Studio?
Have you checked out the node Azure Command Line Tools? This will likely hold the solution to your problems. These tools allow you to neatly manage your mobile service from your dev machine. The newly added cli tools for Mobile Services also support downloading your scripts. Just run the following command in your Azure Powershell:
azure mobile script download <service_name> <script_name>
The script name syntax is as follows:
For tables: table/.{insert|read|update|delete}
Apple Push Notification: shared/apnsFeedback
Scheduler: scheduler/
Once you have your scripts downloaded and placed on your local filesystem, you could put them in source control with your client that consumes your mobile service, or just throw them in their own git repository. You can't, however, sync your source control repository with your mobile service. In order to upload any changes you've made to your scripts, you'd need to execute the following command in the Azure-CLI again:
azure mobile script upload <service_name> <script_name>
I'm not sure if you can upload multiple scripts at once though. You could probably use some of the Azure-CLI Automation scripts I saw Glenn Block post on github. This could allow you to somehow automate uploading the scripts as a part of your build workflow.
Edit:
I found a few more resources that might help you with this:
Getting started with the CLI and backing up your scripts
More CLI – changing your Mobile Services workflow
These are some great resources from Josh Twist. I'm sure they will push you in the right direction.
Since this question has been answered, a new feature has been added to Azure Mobile Services - integration with Git source control. Basically you can enable this feature in the dashboard of your mobile service, and it converts the storage in a Git repository which you can clone / pull and push updates to.
You can find more information in the tutorial at http://www.windowsazure.com/en-us/develop/mobile/tutorials/store-scripts-in-source-control/.