Hello all, I have configured a Sagemaker notebook...
# ask-metaflow
a
Hello all, I have configured a Sagemaker notebook instance that has access to Metaflow. Unfortunately, I seem to be getting an error. Not sure if it's related to Python 3.10 not being compatible w/ Metaflow?
1
Full traceback:
Copy code
Traceback (most recent call last):
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/cli.py", line 1172, in main
    start(auto_envvar_prefix="METAFLOW", obj=state)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 829, in __call__
    return self.main(args, kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, ctx.params)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/_vendor/click/core.py", line 610, in invoke
    return callback(args, kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/cli.py", line 691, in wrapper
    return func(args, kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/_vendor/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, args, kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/cli.py", line 830, in run
    runtime = NativeRuntime(
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/runtime.py", line 80, in __init__
    self._run_id = metadata.new_run_id()
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/plugins/metadata/service.py", line 76, in new_run_id
    v, _ = self._new_run(tags=tags, sys_tags=sys_tags)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/plugins/metadata/service.py", line 288, in _new_run
    self._get_or_create("flow")
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/plugins/metadata/service.py", line 380, in _get_or_create
    return self._request(self._monitor, obj_path, "GET")
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/metaflow/plugins/metadata/service.py", line 415, in _request
    resp = requests.get(url, headers=SERVICE_HEADERS)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, kwargs)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/requests/sessions.py", line 573, in request
    prep = self.prepare_request(req)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request
    p.prepare(
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/requests/models.py", line 368, in prepare
    self.prepare_url(url, params)
  File "/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/requests/models.py", line 439, in prepare_url
    raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL 'flows/HelloAWSFlow': No scheme supplied. Perhaps you meant <http://flows/HelloAWSFlow>?

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
v
strange. 3.10 should be fine. What's the version of
requests
? Can you run
Copy code
python -c 'import requests; print(requests.__version__)'
or just
requests.__version__
in your notebook
a
2.28.1
v
I have the same setup and it works fine. It might be some issue with your Metaflow config. Maybe malformed
METAFLOW_SERVICE_URL
? 🤔
a
Good to know. Thanks for checking Ville. I did disable API Gateway (as per this thread). So it's blank. There's only an
METAFLOW_SERVICE_INTERNAL_URL
now.
v
yeah, that might be the issue - it expects to prepend the service address in the URL
a
I think it works now. I just duplicated the
METAFLOW_SERVICE_INTERNAL_URL
as the
METAFLOW_SERVICE_URL
.
among us party 1