Cannot delete datasource

I want to delete datasource, but I get the error:

Cannot delete datasource since it has 1 action(s) using it.

I don’t see any dependencies.
How can I see what is the source of the error?

Hey @ivp! The datasources are available at the org level. Hence even if you don’t see a query/API (action) in your current app, you might have it in some other app in the same org.

Hi, @pranav
No, I had only one app.

I exported the application to json file and found mentions of this datasource in actionList.unpublishedAction, and actionList.publishedAction.
The same action cf_marketing_source action.
I had this action, but I deleted it in Editor.
I don’t see the cf_marketing_source action in the Editor, but for some reason, it exists in the configuration file:

    "actionList": [
        {
            "id": "Books_cf_marketing_source",
            "userPermissions": ["read:actions", "execute:actions", "manage:actions"],
            "gitSyncId": "6234a7cb6be69146195393db_62378eeaa38e4a02f4d8c1be",
            "pluginType": "API",
            "pluginId": "restapi-plugin",
            "unpublishedAction": {
                "name": "cf_marketing_source",
                "datasource": {
                    "id": "backend-cf",
                    "userPermissions": [],
                    "pluginId": "restapi-plugin",
                    "messages": [],
                    "isValid": true,
                    "new": false,
                },
                "pageId": "Books",
                "actionConfiguration": {
                    "timeoutInMillisecond": 10000,
                    "paginationType": "NONE",
                    "path": "/marketing_source",
                    "headers": [],
                    "encodeParamsToggle": true,
                    "queryParameters": [],
                    "httpMethod": "GET",
                    "pluginSpecifiedTemplates": [{"value": true}],
                    "formData": {"apiContentType": "none"},
                },
                "executeOnLoad": true,
                "dynamicBindingPathList": [],
                "isValid": true,
                "invalids": [],
                "messages": [],
                "jsonPathKeys": ["appsmith.user.email", "global.cfUserToken"],
                "confirmBeforeExecute": false,
                "deletedAt": "2022-03-22T12:00:42Z",
                "userPermissions": [],
                "validName": "cf_marketing_source",
            },
            "publishedAction": {
                "name": "cf_marketing_source",
                "datasource": {
                    "id": "backend-cf",
                    "userPermissions": [],
                    "pluginId": "restapi-plugin",
                    "messages": [],
                    "isValid": true,
                    "new": false,
                },
                "pageId": "Books",
                "actionConfiguration": {
                    "timeoutInMillisecond": 10000,
                    "paginationType": "NONE",
                    "path": "/marketing_source",
                    "headers": [],
                    "encodeParamsToggle": true,
                    "queryParameters": [],
                    "httpMethod": "GET",
                    "pluginSpecifiedTemplates": [{"value": true}],
                    "formData": {"apiContentType": "none"},
                },
                "executeOnLoad": true,
                "dynamicBindingPathList": [],
                "isValid": true,
                "invalids": [],
                "messages": [],
                "jsonPathKeys": ["appsmith.user.email"],
                "confirmBeforeExecute": false,
                "userPermissions": [],
                "validName": "cf_marketing_source",
            },
            "new": false,
        },
 

@ivp have you published the application after you deleted the action in edit mode. Your action might still be present in published mode

@Abhvsn
Thanks, it helped!

For some reason on the first app deployment, the datasource stood unchanged (I even got errors on API calls from yesterday’s ngrok URLs).
But after the second deployment, I didn’t get errors from the old cf_marketing_source action and was able to delete the old datasource.