Failed : failed to import app: must specify a mongo service ID

Trying to setup github auto deployment and i’m hit with this!

It used to work but then I copy pasted some trigger files from a different project and now here I am…

1 Like

Hi Alexandar,

The triggers you copied from a different project probably have a different service_name in the file. Please ensure that the correct service is specified that references to the data source in the app you’re importing to.

Regards
Manny

Service name would be the same. “mongodb-atlas”,

But I noticed the cron and auth triggers didn’t have a service name. Could that be it?

Also appriciate your quick response. been stuck on this an entire day…

Have you enabled custom user data?
If so please check your /auth/custom_user_data.json file and ensure the mongo_service_name is “mongodb-atlas”

Regards

Please also share your data_sources/mongodb-atlas/config.json file with the clusterName redacted.

/auth/custom_user_data.json is mongo_service is set to mongodb-atlas :white_check_mark:

{
    "name": "mongodb-atlas",
    "type": "mongodb-atlas",
    "config": {
        "clusterName": "🤐",
        "readPreference": "primary",
        "wireProtocolEnabled": false
    },
    "version": 1
}

I can make changes from the UI, then it pushed to github. When I pull, add one comment in a function and push it doesn’t work

Does the clusterName value in your data source reflect the actual name of the cluster?

I can make changes from the UI, then it pushed to github. When I pull, add one comment in a function and push it doesn’t work

If I understand correctly you’re using both realm-cli and github commits to make changes.
Please know that you should not be using realm-cli while github auto-deploy is enabled since realm-cli will only be able to push to the UI but it will not update the github repo. Only changes made directly in the UI will push to github.

I would recommend doing a fresh pull using realm-cli, and update your github repo with that state, after this point do not use realm-cli to push changes.

Regards

yes.

No i’m using the UI and github. NOT realm-cli

Ok. Brb

No i’m using the UI and github. NOT realm-cli

Understood.
At which point does the error happen? i.e. when making a change in the UI or pushing down from github?
Also what is the related app id (from the URL) ?

Nope.

Do you know where this issue stems from? What is mongo service ID?

Not sure. How can I find out?

Making changes form the UI works great! Making changes from VS Code and then pushing causes this error.

I’m experiencing this issue too

Actually I’m getting close to narrowing it down, it might have to do with default roles
I pulled my main app down and was able to cd into the local directory and push it,

So to give you a little more context, I created a new app, but recently I had issues with watch streams as well, but when I edited default roles it my issue with changestreams was resolved, I’m going to do a little more problem solving and report back what I find

2 Likes

What is mongo service ID?

This would be the data source id.
If you visit your data source in the app services UI, you’ll find both the service id and app id in the URL.

…/apps/APP_ID/services/SERVICE_ID/config

Got it. Neither of those IDs are mentioned in the project. Sent you DM with the IDs

Facing the same issue all of a sudden.
We use Admin APIs to create a Realm app in the required region and then use the Admin CLI to push the realm application and start the sync.

All of this worked fine and all of a sudden it broke last night.
07:22:43 push failed: must specify a mongo service ID

From custom_user_data.json
“mongo_service_name”: “mongodb-atlas”,

We have the same issue all of a sudden.
We use realm-cli in a Github action to deploy our Atlas apps.

npx realm-cli push --remote="${{env.REALM_APP_ID}}" --include-package-json -y

The error message is the same as for the other posters:

push failed: must specify a mongo service ID

Hey guys after some problem solving , I wasn’t able to narrow down the answer yet, when I created a second brand new mongoDB realm atlas application it worked.

Since Shahil is having issues with an existing app, I’m not sure I can pinpoint exactly what it was.

At first I thought it was a default roles conflict, since my new app had not roles set on the user’s collection, and that was not the case.

Then I thought that it could have been the deployment location, also not the case. (It was the main difference between our app in development and the new app I had made)

Still looking into it, and will let you know if I discover anything. My temporarily solution was to create another realm app. And as I continue my migration, I will see if anyone of the new configurations I set will recreate this error.

Hi Paul,

I did delete and create a new app. Even then the same issue.
We create the realm apps in 2 steps.

  1. Use Admin API to create the realm app in Azure region
  2. Use the Admin CLI to deploy the app.

Now this app was deployed using above to 2 steps and working.
But we added one more collection and hence I had to deploy the update which errored out and then I tried deleting and creating a new version on our dev environment.

Hi All,

I’ve raised this with our developers to investigate what could be causing this error as I’ve not found a reason thus far.

If the error happens when using realm-cli please do reply with the version you’re using.

Otherwise if the error happens when pushing from github please advise if the github integration was working previously or if you’re getting the error immediately after setting up github auto-deploy.

Regards

2 Likes