Hi, <@UP4D9EY6T> let's dicuss this PR here! <https...
# contribute
d
Hi, @steep-jackal-21573 let's dicuss this PR here! https://github.com/flyteorg/flytekit/pull/2938#issuecomment-2580221976
I'm trying to repro your error
so that I can use debugger to fix the error
image.png
the config is None
when I am using the code below
Copy code
if __name__ == "__main__":
    from flytekit.clis.sdk_in_container import pyflyte
    from click.testing import CliRunner
    import os

    runner = CliRunner()
    path = os.path.realpath(__file__)
    os.environ["FLYTE_PLATFORM_URL"] = "localhost:30080"
    result = runner.invoke(pyflyte.main, ["info",])
    print(result.output)
Copy code
/Users/future-outlier/miniconda3/envs/dev/bin/python /Users/future-outlier/code/dev/flytekit/build/oss/issue_0109_honnix_pyflyte_info_bug/example.py 
22:01:24.010028 INFO     file.py:252 - Using flytectl/YAML config               
                         /Users/future-outlier/.flyte/config-sandbox.yaml       
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1736431285.186100 27684812 <http://config.cc:230]|config.cc:230]> gRPC experiments enabled: call_status_override_on_cancellation, event_engine_dns, event_engine_listener, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
22:01:25.210203 INFO     raw.py:64 - Flyte Client configured -> localhost:30080 
                         in insecure mode.                                      
╭───────────────────────────── Flytekit CLI Info ──────────────────────────────╮
│                                                                              │
│                                                                              │
│ This CLI is meant to be used within a virtual environment that has Flytekit  │
│ installed. Ideally it is used to iterate on your Flyte workflows and tasks.  │
│                                                                              │
│ Flytekit Version: 1.14.0b7.dev29+g82c0b61e8                                  │
│ Flyte Backend Version: unknown                                               │
│ Flyte Backend Endpoint: localhost:30080                                      │
│                                                                              │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯


Process finished with exit code 0
so to repro your error, I should delete my local config file?
s
I think so
d
ok will try it and give you feedback
thanks
s
np
d
Copy code
(dev) future@outlier ~ % FLYTECTL_CONFIG=""  pyflyte info                                     
23:34:48.331862 INFO     file.py:272 - Using flytectl/YAML config /Users/future-outlier/.flyte/config.yaml                                                              
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1736436889.497775 27774768 <http://config.cc:230]|config.cc:230]> gRPC experiments enabled: call_status_override_on_cancellation, event_engine_dns, event_engine_listener, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
23:34:49.523693 INFO     raw.py:64 - Flyte Client configured -> localhost:30081 in secure mode.                                                                         
I0000 00:00:1736436889.526014 27774856 <http://subchannel.cc:806]|subchannel.cc:806]> subchannel 0x16d787740 {address=ipv6:%5B::1%5D:30081, args={grpc.client_channel_factory=0x600000645080, grpc.default_authority=localhost:30081, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x60000201c660, grpc.internal.client_channel_call_destination=0x10631ba18, grpc.internal.event_engine=0x60000064bc90, grpc.internal.security_connector=0x600002abdd80, grpc.internal.subchannel_pool=0x600002f74070, grpc.max_metadata_size=32768, grpc.max_receive_message_length=20971520, grpc.primary_user_agent=grpc-python/1.65.1, grpc.resource_quota=0x600000ab1020, grpc.server_uri=dns:///localhost:30081}}: connect failed (UNKNOWN:Failed to connect to remote host: connect: Connection refused (61) {created_time:"2025-01-09T23:34:49.525642+08:00"}), backing off for 1000 ms
I0000 00:00:1736436889.526183 27774856 <http://subchannel.cc:806]|subchannel.cc:806]> subchannel 0x16d77de00 {address=ipv4:127.0.0.1:30081, args={grpc.client_channel_factory=0x600000645080, grpc.default_authority=localhost:30081, grpc.http2_scheme=https, grpc.internal.channel_credentials=0x60000201c660, grpc.internal.client_channel_call_destination=0x10631ba18, grpc.internal.event_engine=0x60000064bcc0, grpc.internal.security_connector=0x600002abde00, grpc.internal.subchannel_pool=0x600002f74070, grpc.max_metadata_size=32768, grpc.max_receive_message_length=20971520, grpc.primary_user_agent=grpc-python/1.65.1, grpc.resource_quota=0x600000ab1020, grpc.server_uri=dns:///localhost:30081}}: connect failed (UNKNOWN:Failed to connect to remote host: connect: Connection refused (61) {created_time:"2025-01-09T23:34:49.52615+08:00"}), backing off for 1000 ms
RPC Failed, with Status: StatusCode.UNAVAILABLE
        Details: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:30081: Failed to connect to remote host: connect: Connection refused (61)
I think I might know the error
the default endpoint should be 30080
Copy code
RPC Failed, with Status: StatusCode.UNAVAILABLE
        Details: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:30081: Failed to connect to remote host: connect: Connection refused (61)
is this error what you met?
cc @steep-jackal-21573
s
the port doesn't matter. it's more about pyflyte does not respect
FLYTE_PLATFORM_URL
(etc.) env var, unless I give it a config file (doesn't have to exist).
d
so weird
but the bug
really exist
thank you for the bug report
when I use flytekit 1.12.3
it didn't have any error
Copy code
(flytkit-3.11) future@outlier ~ % FLYTECTL_CONFIG=""  FLYTE_PLATFORM_URL="dns:///localhost:30080" pyflyte info

23:53:17.127627 INFO     Using flytectl/YAML config /Users/future-outlier/.flyte/config.yaml                                                                                             file.py:273
23:53:17.184251 INFO     Registering Sensor for task type: sensor_v0                                                                                                               base_agent.py:213
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1736437997.259115 27796857 <http://config.cc:230]|config.cc:230]> gRPC experiments enabled: call_status_override_on_cancellation, event_engine_dns, event_engine_listener, http2_stats_fix, monitoring_experiment, pick_first_new, trace_record_callops, work_serializer_clears_time_cache
23:53:17.275948 INFO     Flyte Client configured -> localhost:30080 in secure mode.                                                                                                        raw.py:63
╭─────────────────────────────────────────────────────────────────────────────────────── Flytekit CLI Info ────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                  │
│                                                                                                                                                                                                  │
│ This CLI is meant to be used within a virtual environment that has Flytekit installed. Ideally it is used to iterate on your Flyte workflows and tasks.                                          │
│                                                                                                                                                                                                  │
│ Flytekit Version: 1.12.3                                                                                                                                                                         │
│ Flyte Backend Endpoint: localhost:30080                                                                                                                                                          │
│                                                                                                                                                                                                  │
│                                                                                                                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
s
exactly because it respects those env vars.
d
it seems that in your integration test, you had to provide a config to set
insecure=True
to make the request work.
Copy code
admin:
  # For GRPC endpoints you might want to use dns:///flyte.myexample.com
  endpoint: dns:///localhost:30080
  insecure: true
I'm still investigating.
Hi, @steep-jackal-21573 can you help me confirm that in your integration test, this can work with flytekit 1.14.3 (latest one)?
Copy code
$ FLYTE_PLATFORM_URL=<somewhere> pyflyte --config foo info
I'm reading how flyteadmin handle grpc request
will bring more information here later
s
I think it is a pyflyte problem. I didn't list all env vars we set.
I believe it's the newly added code that talks to flyteadmin somehow requires a config file to be specified.
d
let me give you more details about this problem
so in flytekit 1.14.3, we will send a grpc request to flyteadmin to get flyte's backend version. we will provide 2 variables. 1. insecure (True/False) 2. endpoint (localhost:30080)
and if we set insecure=False, we will face the error
s
Copy code
$ FLYTE_PLATFORM_URL=foo pyflyte info
RPC Failed, with Status: StatusCode.UNAVAILABLE
	Details: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:30080: Failed to connect to remote host: connect: Connection refused (61)
$ FLYTE_PLATFORM_URL=foo pyflyte --config foo  info
RPC Failed, with Status: StatusCode.UNAVAILABLE
	Details: DNS resolution failed for foo: C-ares status is not ARES_SUCCESS qtype=A name=foo is_balancer=0: DNS server returned answer with no data
If you compare these two commands, the first one doesn't even bother reading
FLYTE_PLATFORM_URL
.
Which mean unless
--config <something>
is provided, those env vars won't be read.
d
oh thank you
I have a direction to debug
thank you so much
s
sure thing. thank you for looking into this.
d
I got other priority now, but will come back here at Friday < 3
s
Sure. This is not something urgent.