Policy Client configuration Loggin error

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

Hi everyone,
I upgraded my code from ray 1.13 to 2.0.1. I have a server-client configuration for multi-agents that it worked in the previous version. Now when I run the server I have this messeges:

WARNING deprecation.py:47 -- DeprecationWarning: `ray.rllib.algorithms.dqn.dqn.DEFAULT_CONFIG` has been deprecated. Use `ray.rllib.algorithms.dqn.dqn.DQNConfig(...)` instead. This will raise an error in the future!

INFO algorithm.py:2055 -- Executing eagerly (framework='tf2'), with eager_tracing=True. For production workloads, make sure to set eager_tracing=True  in order to match the speed of tf-static-graph (framework='tf'). For debugging 
purposes, `eager_tracing=False` is the best choice.

WARNING deprecation.py:47 -- DeprecationWarning: `config['multiagent']['replay_mode']` has been deprecated. config['replay_buffer_config']['replay_mode'] This will raise an error in the future!

WARNING deprecation.py:47 -- DeprecationWarning: `simple_optimizer` has been deprecated. This will raise an error in the future!

WARNING deprecation.py:47 -- DeprecationWarning: `config['multiagent']['replay_mode']` has been deprecated. config['replay_buffer_config']['replay_mode'] This will raise an error in the future!

The first WARNING I don’t know why apears, because I set:

import ray.rllib.algorithms.dqn as dqn
config = dqn.DQNConfig()

And WARNINGS number two and three I don’t know what to do, I have the defaut configuration there.

But the problem is not that, my server is working. When I run the client script I have the following message:

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\env\policy_client.py", line 303, in run
    samples = self.rollout_worker.sample()
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\evaluation\rollout_worker.py", line 810, in sample
    batches = [self.input_reader.next()]
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\evaluation\sampler.py", line 92, in next
    batches = [self.get_data()]
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\evaluation\sampler.py", line 282, in get_data
    item = next(self._env_runner)
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\evaluation\sampler.py", line 684, in _env_runner
    active_envs, to_eval, outputs = _process_observations(
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\evaluation\sampler.py", line 1018, 
in _process_observations
    callbacks.on_episode_step(
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\examples\custom_metrics_and_callbacks.py", line 66, in on_episode_step
    pole_angle = abs(episode.last_observation_for()[2])
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\logging\__init__.py", line 1083, in emit
    msg = self.format(record)
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\logging\__init__.py", line 927, in format
    return fmt.format(record)
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\logging\__init__.py", line 663, in format
    record.message = record.getMessage()
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\logging\__init__.py", line 367, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\threading.py", line 937, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\Usuario\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\rllib\env\policy_client.py", line 324, in run
    logger.info("Error: inference worker thread died!", e)
Message: 'Error: inference worker thread died!'
Arguments: (TypeError("'NoneType' object is not subscriptable"),)

I can not to resolve the problem. Any suggestion?
Thanks!

(My files are here: Sign in to your account )

The first deprecation warning is an error on our side. Sorry for that!
The second warning is only a heads-up that you should switch between tracing/no tracing when going from development to production.
The third warning is an error on our side again. We are sometimes using our own deprecated APIs during deprecation :slight_smile:

Can you set up a reproducible example and maybe file an issue?
It looks like your episode does not contain data for the default agent ID, but you are using the on_episode_step callback from rllib/examples/custom_metrics_and_callbacks.py. I think you should step in there and see, since the episode seems to not be empty, what data is actually in there and from what agent ID to debug this.