# Facing issues when upgraded to ray 2.0.0

**URL:** <https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597>\
**Category:** Ray Core\
**Created:** [April 7, 2021, 1:56pm UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597 "2021-04-07T13:56:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SumanthDatta](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sumanthdatta/32/476_2.png) [@SumanthDatta](https://discuss.ray.io/u/SumanthDatta)\
**Post date:** [April 7, 2021, 1:56pm UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597/1 "2021-04-07T13:56:06Z")

</div>

Hi ,

When we upgraded our environment from 1.2.0 to ray 2.0.0 , we are seeing issues like

“Cloudpickle Error: Unknown type {}”.format(type(obj))  
\_pickle.PicklingError: Cloudpickle Error: Unknown type \<class ‘ray.actor.ActorHandle’\>

PFA for screen shot

 ![ray2.0Issue](https://us1.discourse-cdn.com/flex020/uploads/ray/original/1X/8fac92fee521589ce8dc446c35f15cb6762da24e.png)

Please advice in solving the issue.

---

<div class="post-metadata">

**Author:** ![SumanthDatta](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sumanthdatta/32/476_2.png) [@SumanthDatta](https://discuss.ray.io/u/SumanthDatta)\
**Post date:** [April 7, 2021, 3:15pm UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597/2 "2021-04-07T15:15:07Z")

</div>

This issue is occurring when we iterate on Apache Arrow Objects. From ray 2.0.0 this issue occurs. Previous ray versions work fine. Will investigate further, any suggestions will help.

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [April 7, 2021, 8:39pm UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597/3 "2021-04-07T20:39:24Z")

</div>

Hmm odd. @suquark do you happen to know any change that can cause this?

---

<div class="post-metadata">

**Author:** ![suquark](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/suquark/32/227_2.png) [@suquark](https://discuss.ray.io/u/suquark)\
**Post date:** [April 7, 2021, 8:58pm UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597/4 "2021-04-07T20:58:52Z")

</div>

It looks like an ActorHandle instance is used in type hint parameters (or could be in some third-party libraries related to typing like `typing_extensions` or `pydantic`). This is unusual. If you are sure that the issue is not about your code, we can patch cloudpickle temporarily to suppress errors.

There is a recent change that updates the cloudpickle: [Update cloudpickle to commit 6e0f571 by suquark · Pull Request #14693 · ray-project/ray · GitHub](https://github.com/ray-project/ray/pull/14693). This fixes some of our previous serialization issues and cloudpickle bugs. It modifies `parametrized_type_hint_getinitargs` and is likely to cause this issue.

---

<div class="post-metadata">

**Author:** ![SumanthDatta](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sumanthdatta/32/476_2.png) [@SumanthDatta](https://discuss.ray.io/u/SumanthDatta)\
**Post date:** [April 8, 2021, 9:03am UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597/5 "2021-04-08T09:03:13Z")

</div>

@suquark This issue occurs when we do gather\_async on parallel iterator , trying to verify the issue on our side. Can you confirm if the serialization is done on the data fetched by the worker process or anything else?

---

<div class="post-metadata">

**Author:** ![suquark](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/suquark/32/227_2.png) [@suquark](https://discuss.ray.io/u/suquark)\
**Post date:** [April 8, 2021, 9:07pm UTC](https://discuss.ray.io/t/facing-issues-when-upgraded-to-ray-2-0-0/1597/6 "2021-04-08T21:07:31Z")

</div>

With the provided information, I cannot identify the root cause of the error. I tried some possible setups but I am unable to reproduce such errors. But I know that cloudpickle cannot serialize some weird objects well (especially typing objects, because python seriously considers typing object serialization only since python3.7+, for python \<= 3.6, cloudpickle has to use numerous serialization heuristics to try its best, and it often fails under extreme cases). For your current situation, I can add more heuristics to cloudpickle in Ray to mitigate serialization issues.

I create a PR for the fix: [[WIP] Cloudpickle workaround for false positive cases by suquark · Pull Request #15202 · ray-project/ray · GitHub](https://github.com/ray-project/ray/pull/15202)
