Bluemix CLI on Linux - websocket: bad handshake - linux

I'm able to push and execute a Java sample application under a Bluemix account but when running the log command through the CLI prompt I receive an error message as shown below:
cf logs myapp-myname --recent
Connected, dumping recent logs for app myapp-myname in org myname#xy.red.com / space dev as myname#xy.red.com...
FAILED
websocket: bad handshake
My local platform the runs the CLI is Linux, see the currently installed version:
cf -version
cf version 6.1.2-6a013ca
When accessing the log records through the web console dashboard, all log information is shown correctly.

The error you are seeing is because you are using an old version of Cloud Foundry CLI. This version is not supported in Bluemix.
Please use the link below to get a more recent version:
https://github.com/cloudfoundry/cli/releases

Related

Azure Web App, streamlit stuck in `Please wait...`

I've created a web app service with B1 tier pricing in linux/python3.7
I've hooked up my Azure git to the deployement center, the application builds correctly, I've edited the start command to python -m streamlit run app.py --server.port 8000 --server.address 0.0.0.0. The app launches, I can access to the URL, but streamlit is stuck into Please wait...
I've tried to enable WebSockets, since some people said it was the issue. I could not found the option in the Portal, so I had to use the command az webapp config set --web-sockets-enabled true --name MyAppName --resource-group MyResourceGroup. In the output json, I can see the option enabled.
"webSocketsEnabled": true,
I tried to enable/disable all kind of options in the configuration Portal, but nothing is working. Any idea on what I am doing wrong?
(The app works in local mode, and I don't have access to Docker on my local computer, so I can not use this option to build my docker image)
EDIT 1:
In the chrome console, I get an error:
WebSocket connection to '' failed: WebSocket is closed before the connection is established.
But WebSocket is enabled, or at least from what my previous commands says
After reproducing from my end, I could able to reproduce the same error when the webapp is deployed with python 3.9.
RESULTS:
But when I re-deployed a new Web app with Runtime version- Python 3.10 the error was resolved. The below code works fine when the streamlit app runs locally.
import streamlit as st
st.set_page_config(page_title="My Test app", page_icon=":tada", layout="wide")
# --- HEADER SECTION ----
st.subheader("Hi, I am test app :wave:")
st.title("A test app to test streamlit")
st.write("I am passionate py developer")
st.write("[Learn More >](https://streamlit.io/)")
Python -m streamlit run app.py
RESULTS:
Deployed the same to a new app service on azure with Runtime stack Python version 3.10, OS Linux and SKU B1 Pricing tier (Basic).
Note- Free tier is not supported for Streamlit app atleast B1 or above is mandatory.
Deploy the local code of censusapp in Azure App Service via VS code.
After the code is deployed > Try accessing the website you will receive an application error, to resolve that. Let’s add python -m streamlit run app.py --server.port 8000 --server.address 0.0.0.0> in the startup command in the Configuration.
Disable HTTPS Only to OFF and set the configuration settings as below:-
NOTE: Even if you set this settings to OFF> you can browse your website with https://
After these settings are added and validated, follow the below steps
Browse your website
Wait until the website loads
Now you can see that the error doesn't show up anymore and the website runs successfully in the browser.
Make sure that if your Web app is running on lower Python version than 3.10 Please re-create a new Web App on Azure with runtime stack python 3.10 to resolve this issue.

what happens when the command gcloud app deploy --version v1 is issued to deploy a nodejs application?

Can any one help me understand gcloud app deploy? I tried deploying an application but it gave me the error:
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error
occurred while creating a Google Cloud Storage bucket.
Thanks,
-VR
gcloud is google sdk command to interact with its cloud services, you can read more about it here https://cloud.google.com/sdk/gcloud/
you can run gcloud commands either by installing gcloud sdk or from a gcloud shell where sdk is pre-installed.
gcloud app deploy looks for app.yaml which can be configured based on this documentation https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
To address the error try running this command gcloud config set app/use_deprecated_preparation True; and give a try.
once we run gcloud app deploy --version v1 a version of the application is created and can be accessed by the corresponding url from version column.
one can even login to the running instance of VM by accessing respective instance ssh.
this command will tar ball the folder containing app.yaml and will be used to create the running nodejs instance; the entire deployment depends on PORT being used as part of NodeJS application for running production instance, and a proper package.json which will have all the dependencies listed and contains a start script to run the application.


Deploy ember application in Bluemix

I am trying to deploy an existing ember-nodejs application into bluemix environment. I tried the following steps.
bluemix api https://api.ng.bluemix.net
bluemix login -u username -o org_name -s space_name
cf push app_name
I also tried the above command with an ember build pack from the list of
compatible CF build packs
cf push app_name -b https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks
Uploading is successful, but the application doesnt start up. Is there a recommended way of deploying ember-node js application?
Update
It was a memory issue. I removed the other running apps and tried the cf push command again. The node modules got installed and the application also started without any fuss.
According to the user, this was actually a memory issue. Once he stopped the other running apps, his node modules were installed and the application started without any further errors. There are no issues specific to deploying ember-nodejs applications in the Bluemix environment.

Node.js application in IBM Bluemix gives 503 errors when live edit is used

IBM Devops provides the option of live-edit mode for applications hosted on Bluemix. Once enabled my node.js application failed with 503 errors, but the status of the application seemed fine.
On checking further, found that this was a known issue when Live Edit feature is used against an application running using the Node 4.x runtime on IBM Bluemix.
One way to get around this is by using 'cf' command line tool to push the application with Live Edit disabled initially and then manually enable Live Edit by using the 'cf set-env' command.
At First push the app, ensuring that the "BLUEMIX_APP_MGMT_ENABLE" variable is not set:
$ cf unset-env appName BLUEMIX_APP_MGMT_ENABLE
$ cf push appName
Then enable Live Edit mode manually using the environment variable, and restart the app:
$ cf set-env appName BLUEMIX_APP_MGMT_ENABLE=devconsole+inspector+shell
$ cf restart appName
This should help getting the live edit working for Node.js applications.

Cannot get node hello world app to deploy on GCloud

I cannot for the life of me the the hello world app that google provides to work. I am following the tutorial here: https://cloud.google.com/nodejs/getting-started/hello-world
I have followed all the steps and the hello world code runs perfectly on my local machine. However, when I try to run
gcloud preview app deploy app.yaml --promote
I get the following output:
You are about to deploy the following modules:
- empirical-lens-111022/default (from [C:\Users\zakpt\Downloads\nodejs-getting-started-1-hello-world\nodejs-getting-started-1-hello-world\app.yaml])
Deployed URL: [https://empirical-lens-111022.appspot.com]
Do you want to continue (Y/n)? y
Beginning deployment...
Verifying that Managed VMs are enabled and ready.
Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
ERROR: (gcloud.preview.app.deploy) Couldn't connect to the Docker daemon.
I have no idea what to do, since the Docker isn't mentioned at all in the tutorial, and googling has only shown solutions for OSX. I am on Windows 10

Resources