How to import resources in terraform cloud state

Hi,
I’m trying to import existing resources into a new workspace project, but I’m running into some problems.

When I run “tf import github_repository.infrastructure-template infrastructure-template
it gives this error:

Error: Error acquiring the state lock

│ Error message: resource not found

│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the “-lock=false”
│ flag, but this is not recommended.

When I run: tf import -lock=false github_repository.infrastructure-template infrastructure-template
It gives the error:
Error writing state file: Error uploading state: Conflict

This workspace is not locked and will only accept state uploads
when locked

When I lock the workspace from the web UI and run the import it gives the following error:
Error writing state file: Error uploading state: Conflict

This workspace is locked by User
foobar and will only accept state uploads from
them while locked.

Is there any way to import resources into Tf cloud, or should I just give up?

In case anyone else runs into this problem:
Double check what kind of token you’ve generated, and double check that the token stored on your local environment is the right one.