Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Getting Name {} is already taken when creating a deployment #238

Closed
aguschin opened this issue May 7, 2022 · 0 comments · Fixed by #255
Closed

Getting Name {} is already taken when creating a deployment #238

aguschin opened this issue May 7, 2022 · 0 comments · Fixed by #255
Labels
bug Something isn't working deploy Related to model deployment

Comments

@aguschin
Copy link
Contributor

aguschin commented May 7, 2022

If you try to have a deployment to already existing app in Heroku, you get this.
I think it should replace the existing deployment by default or provide --force flag.

$ mlem --tb deploy create myservice
⏳️ Loading deployment from myservice.mlem
🔗 Loading link to file://staging.mlem
🔗 Loading link to file://rf.mlem
💾 Updating deployment at myservice.mlem
🏛 Creating Heroku App mlem-quick-start
Traceback (most recent call last):
  File "/Users/aguschin/Git/iterative/mlem/mlem/contrib/heroku/utils.py", line 33, in heroku_api_request
    r.raise_for_status()
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.heroku.com/apps

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/bin/mlem", line 33, in <module>
    sys.exit(load_entry_point('mlem', 'console_scripts', 'mlem')())
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/Users/aguschin/.local/share/virtualenvs/mlem-Utz6DvOn/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/aguschin/Git/iterative/mlem/mlem/cli/main.py", line 271, in inner
    res = f(*iargs, **ikwargs) or {}
  File "/Users/aguschin/Git/iterative/mlem/mlem/cli/deploy.py", line 68, in deploy_create
    deploy(
  File "/Users/aguschin/Git/iterative/mlem/mlem/api/commands.py", line 488, in deploy
    deploy_meta.deploy()
  File "/Users/aguschin/Git/iterative/mlem/mlem/core/objects.py", line 776, in deploy
    return self.get_env().deploy(self)
  File "/Users/aguschin/Git/iterative/mlem/mlem/contrib/heroku/meta.py", line 77, in deploy
    meta.state.app = create_app(meta, api_key=self.api_key)
  File "/Users/aguschin/Git/iterative/mlem/mlem/contrib/heroku/utils.py", line 52, in create_app
    create_data = heroku_api_request(
  File "/Users/aguschin/Git/iterative/mlem/mlem/contrib/heroku/utils.py", line 35, in heroku_api_request
    raise DeploymentError(r.json()["message"]) from e
mlem.core.errors.DeploymentError: Name mlem-quick-start is already taken
@aguschin aguschin added bug Something isn't working deploy Related to model deployment labels May 7, 2022
@aguschin aguschin added this to the Release Critical milestone May 11, 2022
mike0sv added a commit that referenced this issue May 18, 2022
closes #236
closes #238
aguschin pushed a commit that referenced this issue May 19, 2022
* redeploy models
closes #236
closes #238

* fix entrypoint
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working deploy Related to model deployment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant