We are seeing a problem where the prisma deploy is...
# orm-help
r
We are seeing a problem where the prisma deploy is trying to create the stage again even though the stage already exists. This happens during our deployment process. Here is the error we are seeing
Copy code
Creating stage prod for service service-name... !
error	03-Feb-2021 08:12:09	
error	03-Feb-2021 08:12:09	ERROR: Service with name 'service-name' and stage 'prod' already exists
error	03-Feb-2021 08:12:09	
error	03-Feb-2021 08:12:09	{
error	03-Feb-2021 08:12:09	  "data": {
error	03-Feb-2021 08:12:09	    "addProject": null
error	03-Feb-2021 08:12:09	  },
error	03-Feb-2021 08:12:09	  "errors": [
error	03-Feb-2021 08:12:09	    {
error	03-Feb-2021 08:12:09	      "locations": [
error	03-Feb-2021 08:12:09	        {
error	03-Feb-2021 08:12:09	          "line": 2,
error	03-Feb-2021 08:12:09	          "column": 9
error	03-Feb-2021 08:12:09	        }
error	03-Feb-2021 08:12:09	      ],
error	03-Feb-2021 08:12:09	      "path": [
error	03-Feb-2021 08:12:09	        "addProject"
error	03-Feb-2021 08:12:09	      ],
error	03-Feb-2021 08:12:09	      "code": 4005,
error	03-Feb-2021 08:12:09	      "message": "Service with name 'service-name' and stage 'prod' already exists",
error	03-Feb-2021 08:12:09	      "requestId": "local:ckkpkke6206ih08004ib5c5zx"
error	03-Feb-2021 08:12:09	    }
error	03-Feb-2021 08:12:09	  ],
error	03-Feb-2021 08:12:09	  "status": 200
error	03-Feb-2021 08:12:09	}
any help on this would be really great
r
@Rashmi Bidanta 👋 Could you try by deleting the service and deploying again?
r
Hi @Ryan does deleting the service also result in data loss?
r
Deleting the service shouldn’t result in data loss as you’re not deleting the database. You would need to create a new service and update the URL to point to the new service.
r
okay so we could just change the service-name to
service-name1
and still be able to access the same database with
service-name1$prod
?
so in that case the url would look something like https://company.domain.com/service-name1/prod ?
Just to confirm here are the steps we could do right
Copy code
prisma delete -e ENV-FILE
prisma deploy -e ENV-FILE
does that look good? @Ryan
Also it would be helpful to know why this situation might arise all of a sudden while the system is in place for a while now and we have never had any problems with that
r
The above is not the recommended approach by the team and I have asked them for a solution for the same.
👍🏽 1
r
Also I was thinking that if we create a new service then would it not create a new schema in the database something like
service-name$prod
r
Also it would be helpful to know why this situation might arise all of a sudden while the system is in place for a while now and we have never had any problems with that
Yes that’s strange as well. Did the Migration table have any external changes or missing the initial migration or something?
Also I was thinking that if we create a new service then would it not create a new schema in the database something like 
service-name$prod
Yes but I thought creating the service again with the same name might have helped, but I’m not sure of that.
r
the strange thing is that the issue seems to have vanished on its own, and the deployment seems to have gone through
😅 1
r
That's strange