Hello @hubert.stemplewski! Welcome to the community!
This is a very common issue. Here is a solved post regarding Invalid State Errors. I will add an additional thread that discusses the topic as well if the first did not solve your problem.
I hope this helps!
Best,
Alex