How to check if a secret key corresponds to an entity?

I am trying to create a wandb run.

wandb.login(key=wandb_secret_key, relogin=True)
    run = wandb.init(
except Exception:
    raise InvalidWanbInfoConfigurationsExeption(f"wandb_secret_key({wandb_secret_key}) is not associated with wandb_entity_name ({wandb_entity_name})")

I can exception handle like I did, but the subsequent runs are crashing even if wandb_secret_key and wandb_entity_name correspond.

BrokenPipeError                           Traceback (most recent call last)
~/.virtualenvs/tfpipeline/lib/python3.8/site-packages/wandb/sdk/ in init(job_type, dir, config, project, entity, reinit, tags, group, name, notes, magic, config_exclude_keys, config_include_keys, anonymous, mode, allow_val_change, resume, force, tensorboard, sync_tensorboard, monitor_gym, save_code, id, settings)
   1077         try:
-> 1078             run = wi.init()
   1079             except_exit = wi.settings._except_exit

~/.virtualenvs/tfpipeline/lib/python3.8/site-packages/wandb/sdk/ in init(self)
    573   "setting up manager")
--> 574             manager._inform_init(settings=self.settings, run_id=self.settings.run_id)

~/.virtualenvs/tfpipeline/lib/python3.8/site-packages/wandb/sdk/ in _inform_init(self, settings, run_id)
    169         svc_iface = self._get_service_interface()
--> 170         svc_iface._svc_inform_init(settings=settings, run_id=run_id)

~/.virtualenvs/tfpipeline/lib/python3.8/site-packages/wandb/sdk/service/ in _svc_inform_init(self, settings, run_id)
     37         assert self._sock_client
---> 38         self._sock_client.send(inform_init=inform_init)

~/.virtualenvs/tfpipeline/lib/python3.8/site-packages/wandb/sdk/lib/ in send(self, inform_init, inform_start, inform_attach, inform_finish, inform_teardown)
    210             raise Exception("unmatched")
--> 211         self.send_server_request(server_req)
   1115                 os._exit(-1)
-> 1116             raise Exception("problem") from error_seen
   1117     return run

Is there a wat to check if they correspond without creating the run?

Hi @aidev , we appreciate your writing in and are happy to help. As this question was also raised in wandbs’ github issues, we will be tracking the discussion there for continuity.