-
I run opal-server and opal-client. This is the error I got on opal-client
I did some checking on the code and edit it, the error went away. opal_client/data/fetcher.py async def handle_urls(self, urls: List[Tuple[str, FetcherConfig]] = None) -> List[Tuple[str, FetcherConfig, Any]]:
"""
Fetch data for each given url with the (optional) fetching configuration; return the resulting data mapped to each URL
Args:
urls (List[Tuple[str, FetcherConfig]], optional): Urls (and fetching configuration) to fetch from.
Defaults to None - init data_url with HttpFetcherConfig (loaded with the provided auth token).
Returns:
List[Tuple[str,FetcherConfig, Any]]: urls mapped to their resulting fetched data
"""
# tasks
tasks = []
# if no url provided - default to the builtin route
if urls is None:
urls = [(self._data_url, self._default_fetcher_config)]
# create a task for each url
for url, config in urls:
if not config:
config = self._default_fetcher_config
tasks.append(self.handle_url(url, config))
# wait for all data fetches to complete
results = await asyncio.gather(*tasks, return_exceptions=True)
logging.info(results) Please let me know if this is the intended behavior of the function in order for it to work? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
Hi @farhah, welcome to the OPAL community! :) I am missing some information in order to help you:
There's likely no bug here, from the log i am gathering that you ran the client without a valid access token, and so the OPAL server is rejecting the connection with The example configuration shows you how to run both OPAL client and OPAL server in non-secure mode (without token verification), which is great for dev environments. Let me know exactly what you did and we'll continue from there :) |
Beta Was this translation helpful? Give feedback.
-
Hi there! I pip installed opal-server and opal-client
Run opal-server with no problem/error:
|
Beta Was this translation helpful? Give feedback.
-
Hi @farhah, you are indeed running the server in secure mode, and so you should also run the client with a valid access token. You can obtain an access token with this command:
If you are running locally you can omit example output:
You can then start the client with said access token by setting the environment variable
See more details here. |
Beta Was this translation helpful? Give feedback.
-
I did have the token OPAL_CLIENT_TOKEN=eyJ0eXAiOiJ-somejwt-token |
Beta Was this translation helpful? Give feedback.
-
Oh i am sorry i did not see you pass the token. |
Beta Was this translation helpful? Give feedback.
-
Ok, i got it: Your client token is what identifies you against OPAL server, not against the data-source server (the server that is serving the data source entry). In your case, you are using the example data sources (which are served by the OPAL server directly), thus the data source server is also the OPAL server in your case. Assuming your instead of:
you should pass:
More reading: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help Asaf,
|
Beta Was this translation helpful? Give feedback.
-
Probably still a config issue, let's jump on zoom and debug together: |
Beta Was this translation helpful? Give feedback.
-
Ok Asaf, I got it working now. There was a typo at the OPAL_DATA_CONFIG_SOURCES. These 2 docs are helpful in understanding the flow of the data source server. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Cool, i am glad you got it working! :) |
Beta Was this translation helpful? Give feedback.
Ok, i got it:
Your client token is what identifies you against OPAL server, not against the data-source server (the server that is serving the data source entry).
In your case, you are using the example data sources (which are served by the OPAL server directly), thus the data source server is also the OPAL server in your case.
Assuming your
OPAL_CLIENT_TOKEN
iseyJ0...8wsk
, you need to pass the followingOPAL_DATA_CONFIG_SOURCES
:instead of:
you should pass: