Open ezYakaEagle442 opened 2 years ago
/cc @ebullient, @maxandersen, @quarkusio/devtools
I had the same issue while installing quarkus.
Resolved it by installing jbang and adding trust 1)installing jbang. 2)jbang trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
now i need to create a project and play with it.. :)
@bluebird1002 @ezYakaEagle442 just checking you noticed that the cli prints:
"If you trust the url to be safe to run you can do one of the following: 0) Trust once: Add no trust, just run this time 1) Trust limited url in future: jbang trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
Any other response will result in exit."
Did typing 1
+ enter not work for you ?
There is another issue about similar where suggesting is to update the docs to mention it. i'll link that to this.
it was not an issue but discussion at https://github.com/quarkusio/quarkus/issues/22723 - i 'll keep this issue open.
@maxandersen thank you for your reply but as I mentionned : The Quarkus install fails and states that I am prompted to choose a 0/1 option but there is no prompt at all !
I am sorry but as newbbie the user experience is bad because I follow the docs and it does not work, what is different in my case compared to any other users ? is it related to WSL 2 ??
If I have to install jbang first, then that should be documented. I will give it a try and let you know.
What OS are you running ?
Jbang should wait 10 seconds for you to type 1 or 0 then it exits.
@maxandersen jbang does not wait , there is no prompt at all, as I described I run WSL2/Ubuntu 20.04 on Windows 11
Same happens for me on ubuntu 21.10 openjdk version "1.8.0_312" (Not running in WSL)
$ curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
[jbang] https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/2.6.2.Final/quarkus-cli-2.6.2.Final-runner.jar is not from a trusted source thus not running it automatically.
If you trust the url to be safe to run you can do one of the following:
0) Trust once: Add no trust, just run this time
1) Trust limited url in future:
jbang trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
Any other response will result in exit.
[jbang] Type in your choice (0 or 1) and hit enter. Times out after 10 seconds.
[jbang] [ERROR] Could not parse answer as a number. Aborting
[jbang] [ERROR] https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/2.6.2.Final/quarkus-cli-2.6.2.Final-runner.jar is not from a trusted source and user did not confirm trust thus aborting.
If you trust the url to be safe to run are here a few suggestions:
Limited trust:
jbang trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
Trust all subdomains:
jbang trust add *.repo1.maven.org
Trust all sources (WARNING! disables url protection):
jbang trust add *
For more control edit ~/.jbang/trusted-sources.json
[jbang] Run with --verbose for more details
相同的问题,我分开安装就成功了。
mac mini, m1, v12.0.1, java -version openjdk version "16.0.2" 2021-07-20 OpenJDK Runtime Environment GraalVM CE 21.2.0 (build 16.0.2+7-jvmci-21.2-b08) OpenJDK 64-Bit Server VM GraalVM CE 21.2.0 (build 16.0.2+7-jvmci-21.2-b08, mixed mode, sharing)
1、install JBang https://www.jbang.dev/download/
2、jbang trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
3、curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
4、quarkus -version 5、quarkus create && cd code-with-quarkus
curl -Ls https://sh.jbang.dev | bash -s - app setup
jbang trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
curl -Ls https://sh.jbang.dev --verbose | bash -s - app install --fresh --force quarkus@quarkusio
quarkus -version
Trying 104.26.11.211:443...
* TCP_NODELAY set
* Connected to sh.jbang.dev (104.26.11.211) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2330 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
* start date: Sep 6 00:00:00 2021 GMT
* expire date: Sep 5 23:59:59 2022 GMT
* subjectAltName: host "sh.jbang.dev" matched cert's "*.jbang.dev"
* issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55a3a7f97880)
} [5 bytes data]
> GET / HTTP/2
> Host: sh.jbang.dev
> user-agent: curl/7.68.0
> accept: */*
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
} [5 bytes data]
< HTTP/2 302
< date: Mon, 17 Jan 2022 12:31:43 GMT
< location: https://raw.githubusercontent.com/jbangdev/jbang/master/src/main/scripts/jbang
< cf-ray: 6cef9a2a3fd73b4f-CDG
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< vary: Accept-Encoding
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=RelGYj1TC3cwJXfwx5fBvBagFrB8McOMb0SoxkyMgPDG6EVIG8S%2FixLD8gD0dyx7LtHmdQfCerE8XHfW8rMYaophzupWGLNXyg9RxfYnNS0P0oYeFJ%2B9LYMzV6mVCw%3D%3D"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< server: cloudflare
<
{ [0 bytes data]
* Connection #0 to host sh.jbang.dev left intact
* Issue another request to this URL: 'https://raw.githubusercontent.com/jbangdev/jbang/master/src/main/scripts/jbang'
* Trying 185.199.108.133:443...
* TCP_NODELAY set
* Connected to raw.githubusercontent.com (185.199.108.133) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [3067 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=www.github.com
* start date: May 6 00:00:00 2020 GMT
* expire date: Apr 14 12:00:00 2022 GMT
* subjectAltName: host "raw.githubusercontent.com" matched cert's "*.githubusercontent.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x55a3a7f97880)
} [5 bytes data]
> GET /jbangdev/jbang/master/src/main/scripts/jbang HTTP/2
> Host: raw.githubusercontent.com
> user-agent: curl/7.68.0
> accept: */*
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [193 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
} [5 bytes data]
< HTTP/2 200
< cache-control: max-age=300
< content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
< content-type: text/plain; charset=utf-8
< etag: "5592c5aa9cda499f474996ceabf7d569d5f83ea9c2961ce0c6f2b85f0d0542e2"
< strict-transport-security: max-age=31536000
< x-content-type-options: nosniff
< x-frame-options: deny
< x-xss-protection: 1; mode=block
< x-github-request-id: B6D8:16D7:25F712:399C46:61E56183
< accept-ranges: bytes
< date: Mon, 17 Jan 2022 12:31:43 GMT
< via: 1.1 varnish
< x-served-by: cache-cdg20747-CDG
< x-cache: HIT
< x-cache-hits: 1
< x-timer: S1642422704.776773,VS0,VE1
< vary: Authorization,Accept-Encoding,Origin
< access-control-allow-origin: *
< x-fastly-request-id: 550c1eb1dc03aa5944ff46f7edbbed42a02ccb54
< expires: Mon, 17 Jan 2022 12:36:43 GMT
< source-age: 44
< content-length: 6302
<
{ [860 bytes data]
* Connection #1 to host raw.githubusercontent.com left intact
[jbang] Command installed: quarkus
2.6.2.Final
@maxandersen so Jbang works but it is disapointing not to have quarkus setup running fine at first try following the docs
okey, so if you upgrade to latest jbang 0.87 or higher the app install
will verify the script meaning you will be asked about if you are okey running from the various URL locations during install and not when running.
If you don't like that built-in extra safety then sdkman and brew are options for quarkus cli too - that is just more commands to run.
btw. i just noticed steps to reproduce require installing java - that is NOT the case for installing quarkus with jbang. It is for everything else though (sdkman, brew etc.). That is the main reason we have the jbang option there - it requires less steps - but yes; we do ask users to agree they are okey installing things. I think that is a Good thing :) (simpler and with verification for some higher level of security).
hmm - just found a bug in verifying this. it won't ask properly as when using curl install you can't answer the question. let me revert that asap.
okey, figured out why I missed the actual issue - I had a ~/.jbang/trusted-sources.json when running it thus I did not see those issue of getting the message but no wait as originally reported. Sorry for missing that!
So I've submitted https://github.com/quarkusio/quarkus/pull/23134 and https://github.com/quarkusio/quarkusio.github.io/pull/1307 to have the docs document the needed trust call.
I'll still keep the change of jbang app install check the alias is trusted so users don't get asked at first run.
Describe the bug
The Quarkus install fails and states that I am prompted to choose a 0/1 option but there is no prompt at all !
Expected behavior
setup should run sucessfully as described at https://quarkus.io/get-started/
Actual behavior
the Quarkus setup through jbang fails
How to Reproduce?
Reproducer repo : https://github.com/ezYakaEagle442/azure-java-quarkus/blob/main/tools.md
steps :
vim .profile JAVA_HOME="$HOME/jdk-11.0.13+8" PATH="$JAVA_HOME/bin:$PATH"
. .profile
java -version whereis java which java
You get the here under error :
export certificate from https://repo1.maven.org
echo -n | openssl s_client -showcerts -connect repo1.maven.org:443 -servername repo1.maven.org \ | openssl x509 > /tmp/repo1.maven.org.cert
openssl x509 -in /tmp/repo1.maven.org.cert -text -noout
cp /tmp/repo1.maven.org.cert /usr/local/share/ca-certificates sudo update-ca-certificates
If it works, your certificate will be here below :
ll /etc/ssl/certs
Output of
uname -a
orver
Linux MININT-279OPT8 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.13" 2021-10-19 LTS OpenJDK Runtime Environment Microsoft-27990 (build 11.0.13+8-LTS) OpenJDK 64-Bit Server VM Microsoft-27990 (build 11.0.13+8-LTS, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: /mnt/c/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4 Java version: 11.0.13, vendor: Microsoft, runtime: /home/pinpin/jdk-11.0.13+8 Default locale: en, platform encoding: UTF-8 OS name: "linux", version: "5.10.60.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"
Additional information
I run WSL2/Ubuntu 20.04 on Windows 11
I have found related issues at :