To quickly fix Error 1008 when trying to consume a cloud/on-premise based license, restart the system or kill all other process.
We use named locks in our code, unique to the system. It might be possible that if application is not able to get lock it throws this error. This could be due to some other application holding it. OR if there are more than two instances of cloud authorized applications running and one of those might holding the locks.