Closed brizzbuzz closed 1 year ago
Hi @unredundant!
Hard to tell why the sourced functions are not found anymore.
You can get (much more) output when you wrap the SDKMAN! invocation like this:
set -x; sdk version; set +x
+/bin/zsh:1> sdk version
+sdk:2> COMMAND=version
+sdk:3> QUALIFIER=''
+sdk:5> case version (l)
+sdk:5> case version (ls)
+sdk:5> case version (v)
+sdk:5> case version (u)
+sdk:5> case version (i)
+sdk:5> case version (rm)
+sdk:5> case version (c)
+sdk:5> case version (ug)
+sdk:5> case version (d)
+sdk:5> case version (b)
+sdk:5> case version (h)
+sdk:5> case version (e)
+sdk:44> [[ version == home ]]
+sdk:50> [[ version == completion ]]
+sdk:59> [[ version != update ]]
+sdk:60> ___sdkman_check_candidates_cache /Users/megame/.sdkman/var/candidates
+___sdkman_check_candidates_cache:1> local candidates_cache=/Users/megame/.sdkman/var/candidates
+___sdkman_check_candidates_cache:2> [[ -f /Users/megame/.sdkman/var/candidates && -n activemq,ant,asciidoctorj,ballerina,bpipe,btrace,concurnas,connor,cuba,cxf,doctoolchain,flink,gaiden,gradle,gradleprofiler,grails,groovy,groovyserv,hadoop,http4k,infrastructor,java,jbake,jbang,jmc,jmeter,joern,jreleaser,karaf,kcctl,ki,kobweb,kotlin,kscript,layrry,leiningen,maven,mcs,micronaut,mulefd,mvnd,mybatis,neo4jmigrations,pierrot,pomchecker,quarkus,sbt,scala,scalacli,schemacrawler,spark,springboot,sshoogr,taxi,test,tomcat,toolkit,vertx,visualvm,webtau,znai &&+___sdkman_check_candidates_cache:2> find /Users/megame/.sdkman/var/candidates -mmin +43200
+___sdkman_check_candidates_cache:2> [[ -f /Users/megame/.sdkman/var/candidates && -n activemq,ant,asciidoctorj,ballerina,bpipe,btrace,concurnas,connor,cuba,cxf,doctoolchain,flink,gaiden,gradle,gradleprofiler,grails,groovy,groovyserv,hadoop,http4k,infrastructor,java,jbake,jbang,jmc,jmeter,joern,jreleaser,karaf,kcctl,ki,kobweb,kotlin,kscript,layrry,leiningen,maven,mcs,micronaut,mulefd,mvnd,mybatis,neo4jmigrations,pierrot,pomchecker,quarkus,sbt,scala,scalacli,schemacrawler,spark,springboot,sshoogr,taxi,test,tomcat,toolkit,vertx,visualvm,webtau,znai && -n '' ]]
+___sdkman_check_candidates_cache:8> [[ -f /Users/megame/.sdkman/var/candidates && -z activemq,ant,asciidoctorj,ballerina,bpipe,btrace,concurnas,connor,cuba,cxf,doctoolchain,flink,gaiden,gradle,gradleprofiler,grails,groovy,groovyserv,hadoop,http4k,infrastructor,java,jbake,jbang,jmc,jmeter,joern,jreleaser,karaf,kcctl,ki,kobweb,kotlin,kscript,layrry,leiningen,maven,mcs,micronaut,mulefd,mvnd,mybatis,neo4jmigrations,pierrot,pomchecker,quarkus,sbt,scala,scalacli,schemacrawler,spark,springboot,sshoogr,taxi,test,tomcat,toolkit,vertx,visualvm,webtau,znai ]]
+___sdkman_check_candidates_cache:15> __sdkman_echo_debug 'No update at this time. Using existing cache: activemq,ant,asciidoctorj,ballerina,bpipe,btrace,concurnas,connor,cuba,cxf,doctoolchain,flink,gaiden,gradle,gradleprofiler,grails,groovy,groovyserv,hadoop,http4k,infrastructor,java,jbake,jbang,jmc,jmeter,joern,jreleaser,karaf,kcctl,ki,kobweb,kotlin,kscript,layrry,leiningen,maven,mcs,micronaut,mulefd,mvnd,mybatis,neo4jmigrations,pierrot,pomchecker,quarkus,sbt,scala,scalacli,schemacrawler,spark,springboot,sshoogr,taxi,test,tomcat,toolkit,vertx,visualvm,webtau,znai'
+__sdkman_echo_debug:1> [[ false == true ]]
+___sdkman_check_candidates_cache:16> return 0
+sdk:63> ___sdkman_check_version_cache
+___sdkman_check_version_cache:1> local version_url
+___sdkman_check_version_cache:2> local version_file=/Users/megame/.sdkman/var/version
+___sdkman_check_version_cache:4> [[ false != true && -f /Users/megame/.sdkman/var/version &&+___sdkman_check_version_cache:4> find /Users/megame/.sdkman/var/version -mmin +1440
+___sdkman_check_version_cache:4> [[ false != true && -f /Users/megame/.sdkman/var/version && -z '' ]]
+___sdkman_check_version_cache:5> __sdkman_echo_debug 'Not refreshing version cache now...'
+__sdkman_echo_debug:1> [[ false == true ]]
+___sdkman_check_version_cache:6> SDKMAN_REMOTE_VERSION=+___sdkman_check_version_cache:6> bat /Users/megame/.sdkman/var/version
+___sdkman_check_version_cache:6> SDKMAN_REMOTE_VERSION=5.16.0
+sdk:66> SDKMAN_AVAILABLE=true
+sdk:67> [ -z '' ']'
+sdk:68> SDKMAN_OFFLINE_MODE=false
+sdk:72> __sdkman_update_broadcast_and_service_availability
+__sdkman_update_broadcast_and_service_availability:1> __sdkman_determine_broadcast_id
+__sdkman_determine_broadcast_id:1> [[ false == true || version == offline ]]
+__sdkman_determine_broadcast_id:4> __sdkman_secure_curl_with_timeouts https://api.sdkman.io/2/broadcast/latest/id
+__sdkman_secure_curl_with_timeouts:1> [[ false == true ]]
+__sdkman_secure_curl_with_timeouts:4> curl --silent --location --connect-timeout 7 --max-time 10 https://api.sdkman.io/2/broadcast/latest/id
+__sdkman_determine_broadcast_id:4> echo 638493f86344590007b7db85
+__sdkman_update_broadcast_and_service_availability:1> local broadcast_live_id=638493f86344590007b7db85
+__sdkman_update_broadcast_and_service_availability:2> __sdkman_set_availability 638493f86344590007b7db85
+__sdkman_set_availability:1> local broadcast_id=638493f86344590007b7db85
+__sdkman_set_availability:2> echo 638493f86344590007b7db85
+__sdkman_set_availability:2> rg --files
+__sdkman_set_availability:2> tree --fromfile '[:upper:]' '[:lower:]'
+__sdkman_set_availability:2> grep html
+__sdkman_set_availability:2> local detect_html=''
+__sdkman_set_availability:3> [[ -z 638493f86344590007b7db85 ]]
+__sdkman_set_availability:6> [[ -n '' ]]
+__sdkman_set_availability:10> SDKMAN_AVAILABLE=true
+__sdkman_update_broadcast_and_service_availability:3> __sdkman_update_broadcast 638493f86344590007b7db85
+__sdkman_update_broadcast:1> local broadcast_live_id broadcast_id_file broadcast_text_file broadcast_old_id
+__sdkman_update_broadcast:3> broadcast_live_id=638493f86344590007b7db85
+__sdkman_update_broadcast:4> broadcast_id_file=/Users/megame/.sdkman/var/broadcast_id
+__sdkman_update_broadcast:5> broadcast_text_file=/Users/megame/.sdkman/var/broadcast
+__sdkman_update_broadcast:6> broadcast_old_id=''
+__sdkman_update_broadcast:8> [[ -f /Users/megame/.sdkman/var/broadcast_id ]]
+__sdkman_update_broadcast:9> broadcast_old_id=638493f86344590007b7db85
+__sdkman_update_broadcast:12> [[ -f /Users/megame/.sdkman/var/broadcast ]]
+__sdkman_update_broadcast:13> BROADCAST_OLD_TEXT=$'==== BROADCAST =================================================================\n* 2022-11-28: neo4jmigrations 1.15.0 available on SDKMAN! https://github.com/michael-simons/neo4j-migrations/releases/tag/1.15.0\n* 2022-11-25: quarkus 2.14.2.Final available on SDKMAN! https://github.com/quarkusio/quarkus/releases/tag/2.14.2.Final\n* 2022-11-25: quarkus 2.13.5.Final available on SDKMAN! https://github.com/quarkusio/quarkus/releases/tag/2.13.5.Final\n================================================================================'
+__sdkman_update_broadcast:16> [[ true == true && 638493f86344590007b7db85 != 638493f86344590007b7db85 ]]
+sdk:75> [ -f /Users/megame/.sdkman/etc/config ']'
+sdk:76> source /Users/megame/.sdkman/etc/config
+/Users/megame/.sdkman/etc/config:1> sdkman_auto_answer=false
+/Users/megame/.sdkman/etc/config:2> sdkman_auto_complete=true
+/Users/megame/.sdkman/etc/config:3> sdkman_auto_env=false
+/Users/megame/.sdkman/etc/config:4> sdkman_auto_update=true
+/Users/megame/.sdkman/etc/config:5> sdkman_beta_channel=false
+/Users/megame/.sdkman/etc/config:6> sdkman_checksum_enable=true
+/Users/megame/.sdkman/etc/config:7> sdkman_colour_enable=true
+/Users/megame/.sdkman/etc/config:8> sdkman_curl_connect_timeout=7
+/Users/megame/.sdkman/etc/config:9> sdkman_curl_max_time=10
+/Users/megame/.sdkman/etc/config:10> sdkman_debug_mode=false
+/Users/megame/.sdkman/etc/config:11> sdkman_insecure_ssl=false
+/Users/megame/.sdkman/etc/config:12> sdkman_rosetta2_compatible=false
+/Users/megame/.sdkman/etc/config:13> sdkman_selfupdate_feature=true
+sdk:80> [[ -z version ]]
+sdk:86> CMD_FOUND=''
+sdk:87> [[ version != selfupdate ]]
+sdk:88> CMD_TARGET=/Users/megame/.sdkman/src/sdkman-version.sh
+sdk:89> [[ -f /Users/megame/.sdkman/src/sdkman-version.sh ]]
+sdk:90> CMD_FOUND=/Users/megame/.sdkman/src/sdkman-version.sh
+sdk:95> CMD_TARGET=/Users/megame/.sdkman/ext/sdkman-version.sh
+sdk:96> [[ -f /Users/megame/.sdkman/ext/sdkman-version.sh ]]
+sdk:101> [[ -z /Users/megame/.sdkman/src/sdkman-version.sh ]]
+sdk:109> echo activemq ant asciidoctorj ballerina bpipe btrace concurnas connor cuba cxf doctoolchain flink gaiden gradle gradleprofiler grails groovy groovyserv hadoop http4k infrastructor java jbake jbang jmc jmeter joern jreleaser karaf kcctl ki kobweb kotlin kscript layrry leiningen maven mcs micronaut mulefd mvnd mybatis neo4jmigrations pierrot pomchecker quarkus sbt scala scalacli schemacrawler spark springboot sshoogr taxi test tomcat toolkit vertx visualvm webtau znai
+sdk:109> grep -w ''
+sdk:109> local sdkman_valid_candidate=''
+sdk:110> [[ -n '' ]]
+sdk:117> [[ version == offline ]]
+sdk:123> local final_rc=0
+sdk:126> local native_command=/Users/megame/.sdkman/libexec/version
+sdk:129> echo version
+sdk:129> rg --files
+sdk:129> tree --fromfile - _
+sdk:129> local converted_command_name=$'- [error opening dir]\n_ [error opening dir]\n\n0 directories, 0 files'
+sdk:131> [ -f /Users/megame/.sdkman/libexec/version ']'
+sdk:144> [ -n /Users/megame/.sdkman/src/sdkman-version.sh ']'
+sdk:146> $'__sdk_- [error opening dir]\n_ [error opening dir]\n\n0 directories, 0 files' '' '' ''
sdk:146: command not found: __sdk_- [error opening dir]\n_ [error opening dir]\n\n0 directories, 0 files
+sdk:147> final_rc=127
+sdk:151> [[ version != selfupdate && true == true && true == true ]]
+sdk:152> __sdkman_auto_update 5.16.0 5.16.0
+__sdkman_auto_update:1> local remote_version version delay_upgrade
+__sdkman_auto_update:3> remote_version=5.16.0
+__sdkman_auto_update:4> version=5.16.0
+__sdkman_auto_update:5> delay_upgrade=/Users/megame/.sdkman/var/delay_upgrade
+__sdkman_auto_update:7> [[+__sdkman_auto_update:7> find /Users/megame/.sdkman/var/delay_upgrade -mtime +1
+__sdkman_auto_update:7> [[ -n '' ]]
+sdk:154> return 127
+/bin/zsh:1> set +x
Hi @unredundant!
As I was expecting, it looks like you've defined a bunch of aliases which collide with commands used by SDKMAN!, e.g. tr
.
We use tr
(the command https://en.m.wikipedia.org/wiki/Tr_(Unix)) to change translate upper to lower case characters, but it seems you have a tr
alias for an invocation of the tree
command.
I also see that you've aliased rg
to grep
which should be okay, as rg
is mostly a dropin replacement (at least for the most common cases).
So I guess unsetting or renaming your tr
alias should fix your problem :).
Oh interesting... well easy fix then :)
Might be nice if there was a check for overridden aliases that would print a friendlier error message for users.
I'll leave it up to you whether this should be closed or converted to an issue about error messages.
Thanks for the help!
I have a wacky idea to avoid aliases overrides, but close the issue for now.
Bug report
Hey. Not sure what has happened, there don't seem to be any recent releases, but my sdkman has become completely unusable. Seemingly overnight, every
sdk
command fails with the following messageTo reproduce
I'm really not sure. It seems to be a permissions issue? maybe something with my file system. But since the error message doesn't print out which directory it is having trouble using, it's hard to say. If there is a debug / developer mode that I can run sdkman in that would give you guys more info, I'd be happy to run that :)
System info
sdk version
results in the same error :(