prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.55k stars 868 forks source link

Deploys to existing service on custom servers on prisma cloud fail for prisma >1.8 #2572

Closed ntziolis closed 6 years ago

ntziolis commented 6 years ago

Bug Using 1.8.4 to deploy to an existing service does NOT work on custom server on prisma cloud

Reproduction

prisma deploy -d
Creating stage prod for service circula!

ERROR: Service with name 'circula' and stage 'prod' already exists

{
  "data": {
    "addProject": null
  },
  "errors": [
    {
      "locations": [
        {
          "line": 2,
          "column": 9
        }
      ],
      "path": [
        "addProject"
      ],
      "code": 4005,
      "message": "Service with name 'circula' and stage 'prod' already exists",
      "requestId": "circula_niko:management:cji0e0md333qdqk09698vczqs"
    }
  ],
  "status": 200
}

Expected behavior? Either:

dpetrick commented 6 years ago

Hello @ntziolis,

automatically migrate schema name from graphcool to managment when prisma cloud servers are updated

As easy as it sounds, it is not easy to do automatically. Additionally, we explicitly decided against implementing magic migrations to avoid confusion. In fact, we implemented the "custom schema name" you mentioned a while ago: https://github.com/prismagraphql/prisma/releases/tag/1.8.0

Cloud servers you created are expected to be unaffected by the 1.8 release, as the old graphcool schemas are configured for cloud deployments before 1.8 that upgraded to 1.8.x.

Can you please elaborate on your specific problem that you're facing? What makes you believe that the schema names are the cause of the issue?

ntziolis commented 6 years ago

Ok so I don't know whats going on anymore:

Are you looking into this on your end, if so please tell me because Im seeing ghosts by now :)

dpetrick commented 6 years ago

I looked at the server configurations and everything is as expected. The error also doesn't indicate that it's using the wrong schema for deployment, otherwise it would return an existing service circular@prod, it seems like a CLI issue. I am in no position at the moment to debug the CLI side, but I will take a closer look at the server setup.

dpetrick commented 6 years ago

It might be a bugged dry run flag in the CLI. Just to make sure: Deploying without the dryrun flag also doesn't work?

ntziolis commented 6 years ago

Same without -d.

Here is what I have been seeing the last 10 mins:

If I hit the deploy service in a loop really hard it seems to increase the success rate slightly but this just feels wrong. This smells like a race condition in the CLI if everything is fine server side.

Im on windows, maybe this is windows specific like the codegen issue?

ntziolis commented 6 years ago

Im getting slightly different errors sometimes now (ever 5th time ish):

ERROR: Project not found: 'management@default'

{
  "errors": [
    {
      "message": "Project not found: 'management@default'",
      "code": 3016,
      "requestId": "circula_niko:api:cji0k4o509mxa0934mimkypaf"
    }
  ],
  "status": 200
}
Get in touch if you need help: https://www.graph.cool/forum
To get more detailed output, run $ export DEBUG="*"
 !    'ENAMETOOLONG': spawn ENAMETOOLONG

There is a reference to spawn in this message which was the cause for the other windows specific issue @marktani Any chance this could be related to spawing issues in windows again?

dpetrick commented 6 years ago

Can you try if it is better now?

ntziolis commented 6 years ago

Yes it now went through 5 successive times! Thank you.

dpetrick commented 6 years ago

Closing for now. Please reopen if you have issues again in the next hours.

ntziolis commented 6 years ago

@dpetrick No need to reopen again, just wanted to add some additional info. I think I was trigger happy when performing the update. Meaning its possible to trigger another update while one update is performing (at least the UI allows me todo it, not sure if the backend does). I did so because the update was not competed after 20+minutes. And I didnt get any visual indication that its still ongoing so I assumed it might not have gone through

Suggestion: Disable ability to execute additional updates while one update is ongoing (in prisma console UI).

grantpant commented 5 years ago

Just in case it helps anyone else, I was getting the error ERROR: Service with name <SERVICE> and stage <STAGE> already exists It decided to work after shutting down and reopening the cmder console.

tanujdoshi commented 5 years ago

@dpetrick No need to reopen again, just wanted to add some additional info. I think I was trigger happy when performing the update. Meaning its possible to trigger another update while one update is performing (at least the UI allows me todo it, not sure if the backend does). I did so because the update was not competed after 20+minutes. And I didnt get any visual indication that its still ongoing so I assumed it might not have gone through

Suggestion: Disable ability to execute additional updates while one update is ongoing (in prisma console UI).

hello i ma new to prisma , can you tell me how you can solve this error , i m getting this from last few days , and still i cant solve it!!