Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'cf push' with non-english app name with no specific host, cf can't allocate a correct host #1214

Closed
ShirleySunCN opened this issue Aug 30, 2017 · 11 comments
Labels

Comments

@ShirleySunCN
Copy link

Command

cf push app 普通中文字符

What occurred

After I pushed it, I found that the app route is wrong.
It can't allocate a correct host and correct route for me.
And I click this route, the app can't start successfully.

What you expected to occur

I expect that when I push an app with non-english name, 'cf' should allocate a correct route for me, and the app can start succesfully.

CLI Version

cf version 6.26.0+9c9a261fd.2017-06-27

CC API Endpoint Version

API Endpoint:https://api.stage1.ng.bluemix.net(CF API Version:2.75.0)

CF Trace

N/A

Platform & Shell Details

Mac OS X 10.11

Any other relevant information

N/A

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/150663057

The labels on this github issue will be updated when the story is started.

@ShirleySunCN ShirleySunCN changed the title 'cf push' with non-english app name, the route is wrong 'cf push' with non-english app name with no specific host, cf can't allocate a correct host Aug 30, 2017
@dkoper
Copy link

dkoper commented Aug 30, 2017

Hi @ShirleySunCN

What is the command exactly that you're running and what is the output?
When I tried, I got an error from my API server:

D:\Users\koperd\Downloads\bin>cf p あうえお -p t\n
...
FAILED
Server error, status code: 400, error code: 210001, message: The route is invalid: host format

@ShirleySunCN
Copy link
Author

@dkoper
Hi, I tried again. I paste message as below.
Firstly, I download the sample code from: https://github.com/IBM-Bluemix/get-started-java
Bluemix CLI tool bundles a Cloud Foundry command line interface in its installation. reference: Bluemix (bx) commands

ShirleydeMacBook-Pro:get-started-java-master shirley$ ls
Dockerfile	README.md	manifest.yml	src
LICENSE		docs		pom.xml		target
ShirleydeMacBook-Pro:get-started-java-master shirley$ bx api https://api.ng.bluemix.net
正在将 API 端点设置为 https://api.ng.bluemix.net...
确定

API 端点:https://api.ng.bluemix.net(CF API 版本:2.75.0)
未登录。请使用 'bx login' 登录。
ShirleydeMacBook-Pro:get-started-java-master shirley$ bluemix login  -o xlsunnb@cn.ibm.com -s test -sso
API 端点:https://api.ng.bluemix.net

一个时间代码(在 https://iam.ng.bluemix.net/oidc/passcode 获取一个)> 
正在认证...
确定

目标组织 xlsunnb@cn.ibm.com

目标空间 test

                
API 端点:   https://api.ng.bluemix.net(API 版本:2.75.0)   
区域:       us-south   
用户:       xlsunnb@cn.ibm.com   
帐户:       无目标帐户,请使用“bx target -c ACCOUNT_ID”   
组织:       xlsunnb@cn.ibm.com   
空间:       test   

Tip: use 'bx cf <command>' to run the Cloud Foundry CLI with Bluemix CLI context.

ShirleydeMacBook-Pro:get-started-java-master shirley$ bx push あうえお
'push' is not a registered command. See 'bx help'.
ShirleydeMacBook-Pro:get-started-java-master shirley$ bx app push あうえお
正在调用“cf push あうえお”...

Using manifest file /Users/shirley/Documents/get-started-java-master/manifest.yml

Creating app あうえお in org xlsunnb@cn.ibm.com / space test as xlsunnb@cn.ibm.com...
OK

Creating route -soaplike-intenseness.mybluemix.net...
OK

Binding -soaplike-intenseness.mybluemix.net to あうえお...
OK

Uploading あうえお...
Uploading app files from: /var/folders/x_/0bwtznkd78n8sb8q16yz1_dc0000gn/T/unzipped-app985551341
Uploading 45.5K, 28 files
Done uploading               
OK

Starting app あうえお in org xlsunnb@cn.ibm.com / space test as xlsunnb@cn.ibm.com...
Downloading liberty-for-java_v3_11-20170710-0312...
Downloading liberty-for-java...
Downloading sdk-for-nodejs...
Downloading python_buildpack...
Downloaded liberty-for-java_v3_11-20170710-0312
Downloading swift_buildpack...
Downloaded dotnet-core
Downloading noop-buildpack...
Downloaded sdk-for-nodejs
Downloading java_buildpack...
Downloaded liberty-for-java
Downloading ruby_buildpack...
Downloaded python_buildpack
Downloading nodejs_buildpack...
Downloaded noop-buildpack
Downloaded swift_buildpack
Downloading go_buildpack...
Downloaded ruby_buildpack
Downloading dotnet-core...
Downloading binary_buildpack...
Downloaded java_buildpack
Downloading xpages_buildpack...
Downloaded nodejs_buildpack
Downloading dotnet-core_v1_0_20-20170620-1449...
Downloading php_buildpack...
Downloaded go_buildpack
Downloading staticfile_buildpack...
Downloaded binary_buildpack
Downloading sdk-for-nodejs_v3_12-20170505-0656...
Downloaded xpages_buildpack
Downloading swift_buildpack_v2_0_6-20170504-0403...
Downloaded dotnet-core_v1_0_20-20170620-1449
Downloaded php_buildpack
Downloaded staticfile_buildpack
Downloaded sdk-for-nodejs_v3_12-20170505-0656
Downloaded swift_buildpack_v2_0_6-20170504-0403
Creating container
Successfully created container
Downloading app package...
Downloaded app package (836.6K)
Staging...
-----> Liberty Buildpack Version: v3.12-20170814-1322
-----> Retrieving IBM 1.8.0_20170727 JRE (ibm-java-jre-8.0-4.10-pxa6480sr4fp10-20170727_01-cloud-unrestricted.tgz) ... (0.0s)
         Expanding JRE to .java ... (1.5s)
-----> Retrieving App Management 1.0.0_unknown (app-mgmt_v1.26.1-20170524-1706.zip) ... (0.0s)
         Expanding App Management to .app-management (0.1s)
-----> Retrieving com.ibm.ws.liberty-17.0.0.2-201708141322.tar.gz ... (0.0s)
         Installing archive ... (1.5s)
-----> Warning: Liberty feature set is not specified. Using the default feature set: ["beanValidation-1.1", "cdi-1.2", "ejbLite-3.2", "el-3.0", "jaxrs-2.0", "jdbc-4.1", "jndi-1.0", "jpa-2.1", "jsf-2.2", "jsonp-1.0", "jsp-2.3", "managedBeans-1.0", "servlet-3.1", "websocket-1.1"]. For the best results, explicitly set the features via the JBP_CONFIG_LIBERTY environment variable or deploy the application as a server directory or packaged server with a custom server.xml file.
-----> Liberty buildpack is done creating the droplet
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (108B)
Uploaded droplet (136.9M)
Uploading complete
Destroying container
Successfully destroyed container

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running

App started


OK

App あうえお was started using this command `.liberty/initial_startup.rb`

Showing health and status for app あうえお in org xlsunnb@cn.ibm.com / space test as xlsunnb@cn.ibm.com...
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: -soaplike-intenseness.mybluemix.net
last uploaded: Thu Aug 31 02:25:21 UTC 2017
stack: cflinuxfs2
buildpack: Liberty for Java(TM) (WAR, liberty-17.0.0_2, buildpack-v3.12-20170814-1322, ibmjdk-1.8.0_20170727, env)

     state     since                    cpu    memory           disk           details
#0   running   2017-08-31 10:28:36 AM   0.0%   131.2M of 256M   194.6M of 1G
ShirleydeMacBook-Pro:get-started-java-master shirley$ 

And you can see the urls is -soaplike-intenseness.mybluemix.net.
Its wrong.

@dkoper
Copy link

dkoper commented Aug 31, 2017

Can you show the output when using our latest cf CLI? I don't know how bx bundles our CLI and what version - we can't support you with that.

@ShirleySunCN
Copy link
Author

I'm sorry about this.
Now I use the latest cf cli, I download this from https://github.com/cloudfoundry/cli#downloads

shirleydembp:~ shirley$ cd /Users/shirley/Documents/IBM\ NoteBook/2017/Project/BLJ17/get-started-java-master/
shirleydembp:get-started-java-master shirley$ ls
Dockerfile	README.md	manifest.yml	src
LICENSE		docs		pom.xml		target
shirleydembp:get-started-java-master shirley$ cf api
api endpoint:   https://api.ng.bluemix.net
api version:    2.75.0
shirleydembp:get-started-java-master shirley$ cf push あうえお
Using manifest file /Users/shirley/Documents/IBM NoteBook/2017/Project/BLJ17/get-started-java-master/manifest.yml

Creating app あうえお in org xlsunnb@cn.ibm.com / space test as xlsunnb@cn.ibm.com...
OK

Creating route -insubordinate-illust.mybluemix.net...
OK

Binding -insubordinate-illust.mybluemix.net to あうえお...
OK

Uploading あうえお...
Uploading app files from: /var/folders/x_/0bwtznkd78n8sb8q16yz1_dc0000gn/T/unzipped-app517409107
Uploading 45.5K, 28 files
Done uploading               
OK

Starting app あうえお in org xlsunnb@cn.ibm.com / space test as xlsunnb@cn.ibm.com...
Downloading noop-buildpack...
Downloading php_buildpack...
Downloading liberty-for-java_v3_11-20170710-0312...
Downloading xpages_buildpack...
Downloading java_buildpack...
Downloaded php_buildpack
Downloading staticfile_buildpack...
Downloaded liberty-for-java_v3_11-20170710-0312
Downloading ruby_buildpack...
Downloaded xpages_buildpack
Downloaded noop-buildpack
Downloading binary_buildpack...
Downloading nodejs_buildpack...
Downloaded java_buildpack
Downloading swift_buildpack_v2_0_6-20170504-0403...
Downloaded staticfile_buildpack
Downloading go_buildpack...
Downloaded binary_buildpack
Downloading sdk-for-nodejs_v3_12-20170505-0656...
Downloaded swift_buildpack_v2_0_6-20170504-0403
Downloading python_buildpack...
Downloaded ruby_buildpack
Downloading dotnet-core_v1_0_20-20170620-1449...
Downloaded nodejs_buildpack
Downloading sdk-for-nodejs...
Downloaded go_buildpack
Downloading liberty-for-java...
Downloaded dotnet-core_v1_0_20-20170620-1449
Downloading dotnet-core...
Downloaded python_buildpack
Downloading swift_buildpack...
Downloaded sdk-for-nodejs_v3_12-20170505-0656
Downloaded sdk-for-nodejs
Downloaded liberty-for-java
Downloaded dotnet-core
Downloaded swift_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (836.6K)
Staging...
-----> Liberty Buildpack Version: v3.12-20170814-1322
-----> Retrieving IBM 1.8.0_20170727 JRE (ibm-java-jre-8.0-4.10-pxa6480sr4fp10-20170727_01-cloud-unrestricted.tgz) ... (0.0s)
         Expanding JRE to .java ... (1.7s)
-----> Retrieving App Management 1.0.0_unknown (app-mgmt_v1.26.1-20170524-1706.zip) ... (0.0s)
-----> Retrieving com.ibm.ws.liberty-17.0.0.2-201708141322.tar.gz ... (0.0s)
         Expanding App Management to .app-management (0.3s)
         Installing archive ... (2.5s)
-----> Warning: Liberty feature set is not specified. Using the default feature set: ["beanValidation-1.1", "cdi-1.2", "ejbLite-3.2", "el-3.0", "jaxrs-2.0", "jdbc-4.1", "jndi-1.0", "jpa-2.1", "jsf-2.2", "jsonp-1.0", "jsp-2.3", "managedBeans-1.0", "servlet-3.1", "websocket-1.1"]. For the best results, explicitly set the features via the JBP_CONFIG_LIBERTY environment variable or deploy the application as a server directory or packaged server with a custom server.xml file.
-----> Liberty buildpack is done creating the droplet
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (109B)
Uploaded droplet (136.9M)
Uploading complete
Destroying container
Successfully destroyed container

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running

App started


OK

App あうえお was started using this command `.liberty/initial_startup.rb`

Showing health and status for app あうえお in org xlsunnb@cn.ibm.com / space test as xlsunnb@cn.ibm.com...
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: -insubordinate-illust.mybluemix.net
last uploaded: Thu Aug 31 04:54:26 UTC 2017
stack: cflinuxfs2
buildpack: Liberty for Java(TM) (WAR, liberty-17.0.0_2, buildpack-v3.12-20170814-1322, ibmjdk-1.8.0_20170727, env)

     state     since                    cpu    memory      disk      details
#0   running   2017-08-31 12:56:00 PM   0.0%   0 of 256M   0 of 1G
shirleydembp:get-started-java-master shirley$ cf -v
cf version 6.29.2+c66d0f342.2017-08-25

And you can see the urls is ** -insubordinate-illust.mybluemix.net**

@dkoper
Copy link

dkoper commented Aug 31, 2017

What hostname would you have expected the CLI to use?

According to the RFCs linked in https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames, hostnames have restrictions on allowable characters.
The cf CLI tries to generate a hostname from your app name, replacing the characters not allowed.
With an all-non-ascii name, nothing is left. In this case, you'll need to help the CLI and specify a hostname using the -n flag.

@ShirleySunCN
Copy link
Author

@dkoper Thanks for your responese.
And you remind that 'The cf CLI tries to generate a hostname from your app name, replacing the characters not allowed.' , I want to know how replace? Just with null ?
When I upload app with all-non-ascii name, CF doen't remind me that the hostname is nothing left, and I just find the app is uploaded successfully.
I think it's not resonable for me.
If CF need I must specify legal hostname, please remind me, and tell me the app uploaded is failed.

@dkoper
Copy link

dkoper commented Sep 18, 2017

I agree it's a bad user experience.
I wonder why this hasn't been raised before - maybe use of non-ascii characters in app names has been uncommon so far? Which makes me wonder what other issues you may uncover...

The code, which I believe has been there forever, simply removes (replace was misleading) the characters not allowed and then does a concatenation with - and the random part.
A better solution would be to do a check on the first string and if empty, simply use the random part without the leading -. We can look into this.

@ShirleySunCN
Copy link
Author

@dkoper Thanks so much for your response.
I think "do a check on the first string and if empty, simply use the random part without the leading -" reasonable for me.

Looking forward to your good news.

@dkoper
Copy link

dkoper commented Jan 10, 2018

This is now resolved in cf CLI 6.34.0.

Regards,
Dies Koper
CF CLI PM

@ShirleySunCN
Copy link
Author

@dkoper Sorry for late response.
This function truly works perfectly now.
Thank you so much !!!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants