Logo-amall

Anybody here tried to deploy via K8s on Azure and got `ArgumentError: Could not parse rfc1738 URL from string ''` when trying to connect? This is the traceback: ```╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /Users/fschulz/.pyenv/versions/3.10.8/bin/zenml:8 in <module> │ │ │ │ 5 from zenml.cli.cli import cli │ │ 6 if __name__ == '__main__': │ │ 7 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │ │ ❱ 8 │ sys.exit(cli()) │ │ 9 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1130 in │ │ __call__ │ │ │ │ 1127 │ │ │ 1128 │ def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any: │ │ 1129 │ │ """Alias for :meth:`main`.""" │ │ ❱ 1130 │ │ return self.main(*args, **kwargs) │ │ 1131 │ │ 1132 │ │ 1133 class Command(BaseCommand): │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1055 in main │ │ │ │ 1052 │ │ try: │ │ 1053 │ │ │ try: │ │ 1054 │ │ │ │ with self.make_context(prog_name, args, **extra) as ctx: │ │ ❱ 1055 │ │ │ │ │ rv = self.invoke(ctx) │ │ 1056 │ │ │ │ │ if not standalone_mode: │ │ 1057 │ │ │ │ │ │ return rv │ │ 1058 │ │ │ │ │ # it's not safe to `ctx.exit(rv)` here! │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1657 in invoke │ │ │ │ 1654 │ │ │ │ super().invoke(ctx) │ │ 1655 │ │ │ │ sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) │ │ 1656 │ │ │ │ with sub_ctx: │ │ ❱ 1657 │ │ │ │ │ return _process_result(sub_ctx.command.invoke(sub_ctx)) │ │ 1658 │ │ │ │ 1659 │ │ # In chain mode we create the contexts step by step, but after the │ │ 1660 │ │ # base command has been invoked. Because at that point we do not │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1404 in invoke │ │ │ │ 1401 │ │ │ echo(style(message, fg="red"), err=True) │ │ 1402 │ │ │ │ 1403 │ │ if self.callback is not None: │ │ ❱ 1404 │ │ │ return ctx.invoke(self.callback, **ctx.params) │ │ 1405 │ │ │ 1406 │ def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]: │ │ 1407 │ │ """Return a list of completions for the incomplete value. Looks │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:760 in invoke │ │ │ │ 757 │ │ │ │ 758 │ │ with augment_usage_errors(__self): │ │ 759 │ │ │ with ctx: │ │ ❱ 760 │ │ │ │ return __callback(*args, **kwargs) │ │ 761 │ │ │ 762 │ def forward( │ │ 763 │ │ __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any # noqa: B902 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/zenml/cli/server.py:775 in │ │ connect │ │ │ │ 772 │ │ ) │ │ 773 │ store_dict["password"] = password │ │ 774 │ │ │ ❱ 775 │ store_type = BaseZenStore.get_store_type(url) │ │ 776 │ if store_type == StoreType.REST: │ │ 777 │ │ store_dict["verify_ssl"] = verify_ssl │ │ 778 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/zenml/zen_stores/base_zen_sto │ │ re.py:177 in get_store_type │ │ │ │ 174 │ │ from zenml.zen_stores.rest_zen_store import RestZenStoreConfiguration │ │ 175 │ │ from zenml.zen_stores.sql_zen_store import SqlZenStoreConfiguration │ │ 176 │ │ │ │ ❱ 177 │ │ if SqlZenStoreConfiguration.supports_url_scheme(url): │ │ 178 │ │ │ return StoreType.SQL │ │ 179 │ │ elif RestZenStoreConfiguration.supports_url_scheme(url): │ │ 180 │ │ │ return StoreType.REST │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/zenml/zen_stores/sql_zen_stor │ │ e.py:402 in supports_url_scheme │ │ │ │ 399 │ │ Returns: │ │ 400 │ │ │ True if the URL scheme is supported, False otherwise. │ │ 401 │ │ """ │ │ ❱ 402 │ │ return make_url(url).drivername in SQLDatabaseDriver.values() │ │ 403 │ │ │ 404 │ def expand_certificates(self) -> None: │ │ 405 │ │ """Expands the certificates in the verify_ssl field.""" │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/sqlalchemy/engine/url.py:725 │ │ in make_url │ │ │ │ 722 │ """ │ │ 723 │ │ │ 724 │ if isinstance(name_or_url, util.string_types): │ │ ❱ 725 │ │ return _parse_rfc1738_args(name_or_url) │ │ 726 │ else: │ │ 727 │ │ return name_or_url │ │ 728 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/sqlalchemy/engine/url.py:786 │ │ in _parse_rfc1738_args │ │ │ │ 783 │ │ return URL.create(name, **components) │ │ 784 │ │ │ 785 │ else: │ │ ❱ 786 │ │ raise exc.ArgumentError( │ │ 787 │ │ │ "Could not parse rfc1738 URL from string '%s'" % name │ │ 788 │ │ ) │ │ 789 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯``` Apparently the URL is not formatted as expected. If I am not supposed to use the cluster address, which one should I go for?

Last active 14 days ago

26 replies

17 views

  • FS

    Anybody here tried to deploy via K8s on Azure and got ArgumentError: Could not parse rfc1738 URL from string '' when trying to connect?

    This is the traceback:
    ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /Users/fschulz/.pyenv/versions/3.10.8/bin/zenml:8 in &lt;module&gt; │ │ │ │ 5 from zenml.cli.cli import cli │ │ 6 if __name__ == '__main__': │ │ 7 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │ │ ❱ 8 │ sys.exit(cli()) │ │ 9 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1130 in │ │ __call__ │ │ │ │ 1127 │ │ │ 1128 │ def __call__(self, *args: t.Any, **kwargs: t.Any) -&gt; t.Any: │ │ 1129 │ │ """Alias for :meth:`main`.""" │ │ ❱ 1130 │ │ return self.main(*args, **kwargs) │ │ 1131 │ │ 1132 │ │ 1133 class Command(BaseCommand): │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1055 in main │ │ │ │ 1052 │ │ try: │ │ 1053 │ │ │ try: │ │ 1054 │ │ │ │ with self.make_context(prog_name, args, **extra) as ctx: │ │ ❱ 1055 │ │ │ │ │ rv = self.invoke(ctx) │ │ 1056 │ │ │ │ │ if not standalone_mode: │ │ 1057 │ │ │ │ │ │ return rv │ │ 1058 │ │ │ │ │ # it's not safe to `ctx.exit(rv)` here! │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1657 in invoke │ │ │ │ 1654 │ │ │ │ super().invoke(ctx) │ │ 1655 │ │ │ │ sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) │ │ 1656 │ │ │ │ with sub_ctx: │ │ ❱ 1657 │ │ │ │ │ return _process_result(sub_ctx.command.invoke(sub_ctx)) │ │ 1658 │ │ │ │ 1659 │ │ # In chain mode we create the contexts step by step, but after the │ │ 1660 │ │ # base command has been invoked. Because at that point we do not │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:1404 in invoke │ │ │ │ 1401 │ │ │ echo(style(message, fg="red"), err=True) │ │ 1402 │ │ │ │ 1403 │ │ if self.callback is not None: │ │ ❱ 1404 │ │ │ return ctx.invoke(self.callback, **ctx.params) │ │ 1405 │ │ │ 1406 │ def shell_complete(self, ctx: Context, incomplete: str) -&gt; t.List["CompletionItem"]: │ │ 1407 │ │ """Return a list of completions for the incomplete value. Looks │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/click/core.py:760 in invoke │ │ │ │ 757 │ │ │ │ 758 │ │ with augment_usage_errors(__self): │ │ 759 │ │ │ with ctx: │ │ ❱ 760 │ │ │ │ return __callback(*args, **kwargs) │ │ 761 │ │ │ 762 │ def forward( │ │ 763 │ │ __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any # noqa: B902 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/zenml/cli/server.py:775 in │ │ connect │ │ │ │ 772 │ │ ) │ │ 773 │ store_dict["password"] = password │ │ 774 │ │ │ ❱ 775 │ store_type = BaseZenStore.get_store_type(url) │ │ 776 │ if store_type == StoreType.REST: │ │ 777 │ │ store_dict["verify_ssl"] = verify_ssl │ │ 778 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/zenml/zen_stores/base_zen_sto │ │ re.py:177 in get_store_type │ │ │ │ 174 │ │ from zenml.zen_stores.rest_zen_store import RestZenStoreConfiguration │ │ 175 │ │ from zenml.zen_stores.sql_zen_store import SqlZenStoreConfiguration │ │ 176 │ │ │ │ ❱ 177 │ │ if SqlZenStoreConfiguration.supports_url_scheme(url): │ │ 178 │ │ │ return StoreType.SQL │ │ 179 │ │ elif RestZenStoreConfiguration.supports_url_scheme(url): │ │ 180 │ │ │ return StoreType.REST │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/zenml/zen_stores/sql_zen_stor │ │ e.py:402 in supports_url_scheme │ │ │ │ 399 │ │ Returns: │ │ 400 │ │ │ True if the URL scheme is supported, False otherwise. │ │ 401 │ │ """ │ │ ❱ 402 │ │ return make_url(url).drivername in SQLDatabaseDriver.values() │ │ 403 │ │ │ 404 │ def expand_certificates(self) -&gt; None: │ │ 405 │ │ """Expands the certificates in the verify_ssl field.""" │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/sqlalchemy/engine/url.py:725 │ │ in make_url │ │ │ │ 722 │ """ │ │ 723 │ │ │ 724 │ if isinstance(name_or_url, util.string_types): │ │ ❱ 725 │ │ return _parse_rfc1738_args(name_or_url) │ │ 726 │ else: │ │ 727 │ │ return name_or_url │ │ 728 │ │ │ │ /Users/fschulz/.pyenv/versions/3.10.8/lib/python3.10/site-packages/sqlalchemy/engine/url.py:786 │ │ in _parse_rfc1738_args │ │ │ │ 783 │ │ return URL.create(name, **components) │ │ 784 │ │ │ 785 │ else: │ │ ❱ 786 │ │ raise exc.ArgumentError( │ │ 787 │ │ │ "Could not parse rfc1738 URL from string '%s'" % name │ │ 788 │ │ ) │ │ 789 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
    Apparently the URL is not formatted as expected. If I am not supposed to use the cluster address, which one should I go for?

  • HA

    Hey @fschulz180 thanks for the report again. Does this come with ZenML version 0.32.0 and you're doing zenml deploy?

  • FS

    Yes, it's 0.32.0 & I am using helm + zenml connect

  • HA

    @Stefan Nica or @Jayesh Sharma perhaps you can help here?

  • ST

    @fschulz180 if this is the error you're getting from calling zenml connect then something strange is happening, because ZenML thinks that the connection URL is a MySQL connection string instead of an HTTP/S URL

  • ST

    could you please paste here the entire zenml connect command you're using (with the username/password bits blurred out, of course) ?

  • FS

    I realized I had to add "https://" in the beginning,
    But now I get RuntimeError: Error initializing rest store ... : HTTPSConnectionPool(...): Max retries exceeded with url: /api/v1/login (Caused by ConnectTimeoutError ... when I run zenml connect --url --username=X --no-verify-ssl

  • HA

    Port is wrong, right?

  • ST

    right :slightlysmilingface: can you try without the port bit @fschulz180?

  • ST

    it also depends on how you deployed ZenML with helm. where does the 8080 port come from ?

  • FS

    It comes from the example on the website

  • FS

    Same error without the port

  • ST

    are you using this guide ?

  • ST

    of the various deployment scenarios describe there, which one are you using ?

  • ST

    the ingress controller is basically the critical part. Depending on whether you use one or not, your connection URL will be different

  • FS

    I only set up a mysql server in Azure and created a DB "zenml", no additional installs.
    Then I adapted the deploy/helm example in the repo, so I could install it.
    Next step would have been to run zenml connect and here we are :sweat_smile:

  • ST

    but you did install the server in a kubernetes cluster with helm, correct ? the helm chart should have given you some output indicating what URL you should use to connect to the server, but that doesn't always happen

  • FS

    I got something like this
    ❯ helm upgrade zenml-server ./zenml-server -n zenml-server Release "zenml-server" has been upgraded. Happy Helming! NAME: zenml-server LAST DEPLOYED: Wed Jan 25 16:08:13 2023 NAMESPACE: zenml-server STATUS: deployed REVISION: 3 NOTES:

  • ST

    did you also install nginx-ingress in the cluster ? or cert-manager ? did you configure helm to use an ingress to expose the zenml server outside the cluster ?

  • FS

    No, to all of those

  • ST

    ah, alright, then you're definitely in the "minimal deployment use-case", at least concerning how you exposed the server :slightlysmilingface:

  • ST

    this means that you have no way to access the zenml server from outside the cluster, so you'll need to use the kubectl port-forward command to forward it to your localhost

  • ST

    but please mind the documented warnings that this is not a setup that you can use in a production setting or something that you can use to run pipelines in the cloud, just something for local experimentation

  • FS

    Hm, apparently the pods are not starting
    ```~/dev/learn-zenml
    ❯ kubectl -n zenml-server port-forward svc/zenml-server 8080:80
    error: unable to forward port because pod is not running. Current status=Pending

    ~/dev/learn-zenml
    ❯ kubectl get pods -n zenml-server
    NAME READY STATUS RESTARTS AGE
    zenml-server-5c58d7bdf4-g7x5x 0/1 Init:CrashLoopBackOff 269 (3m44s ago) 23h
    zenml-server-d4cc5b7b9-2psgh 0/1 Init:CrashLoopBackOff 262 (3m11s ago) 22h```
    I'll ask my DevOps ppl about this tomorrow.
    Thank you so much for your help so far!

  • ST

    FYI, you can take a quick look yourself to see what's happening with the server with a command like kubectl -n zenml-server logs zenml-server-5c58d7bdf4-g7x5x zenml-db-init

  • ST

    I suspect the server can't connect to your Azure database for some reason

Last active 14 days ago

26 replies

17 views