Missing Sandbox Error when Upgrading Stack

I have a stack that deployed and running.
I wanna update the stack using portainer python client but it failed.

Traceback (most recent call last):
  File "upgrade_service.py", line 22, in <module>
    run()
  File "upgrade_service.py", line 18, in run
    update_env_vars=False)
  File "/deploy/portainer/portainer_client.py", line 299, in update_dlpc_stack
    env_vars=env_vars):
  File "/deploy/portainer/portainer_client.py", line 268, in update_stack
    response=response)
portainer.portainer_client.PortainerClientException: Failed to update stacks1: status code <500>, {"err":"Error response from daemon: sandbox 16f2974a4c172d9127a494bdfb115f9b4bac05c83080401e43eb34d333648beb not found","details":"Error response from daemon: sandbox 16f2974a4c172d9127a494bdfb115f9b4bac05c83080401e43eb34d333648beb not found"}

Hi
Thanks for reaching us. could it possible to share the stack file so that we can try it. and pl let us know swarm and portainer version