Custom Actions documentation

In the new version (RC2) we have a new feature to be able to have write access to a database.
When I try to create one to test this out, i got some documentation info, with a link to see an example.

When you click that link you get pointed to:
https://www.metabase.com/docs/v0.46/actions/custom.html

But that page does not exist.

I really want to test this feature out, but have no clue how to use it.

1 Like

It's here: Actions overview

Now I just need to work out why only 3 of my 4 Postgres databases allow me to turn on actions. Needless to say, the one I need isn't working!

@AndrewMBaines are you getting an error in the UI? Or maybe in the network tab in dev tools?
Also does the user you're using for that DB connection have write privileges?

Thanks for the correct link!

I'm not getting an error. Hovering over the 'switch' changes the mouse pointer correctly, but clicking doesn't do anything. It's just the one database. I need to check write privileges (today is supposed to be a day off, so may wait until Monday!).

Got it. Mind reporting back on Monday? And checking your console for what happens after you try to enable it? Even if it's about privileges we should be showing a proper error.

Since you asked nicely!

I've tried this a few times and in both Chrome and Firefox. Consistently gives me this:

[8a7e2454-d41c-4da2-81b2-7866763a6e0a] 2023-03-10T11:51:23+00:00 INFO metabase.models.database :postgres Database 'CarePlanner Combined' sync/analyze schedules have changed! 
 Sync metadata was: '0 38 * * * ? *' is now: '0 46 * * * ? *' 
 Cache FieldValues was: '0 0 13 * * ? *', is now: '0 0 22 * * ? *'
[8a7e2454-d41c-4da2-81b2-7866763a6e0a] 2023-03-10T11:51:23+00:00 INFO metabase.task.sync-databases Scheduling sync/analyze for database 5: trigger: metabase.task.sync-and-analyze.trigger.5
[8a7e2454-d41c-4da2-81b2-7866763a6e0a] 2023-03-10T11:51:23+00:00 INFO metabase.task.sync-databases Scheduling field-values for database 5: trigger: metabase.task.update-field-values.trigger.5
[8a7e2454-d41c-4da2-81b2-7866763a6e0a] 2023-03-10T11:51:23+00:00 DEBUG metabase.server.middleware.log PUT /api/database/5 200 57.4 ms (9 DB calls) App DB connections: 0/13 Jetty threads: 4/50 (7 idle, 0 queued) (77 total active threads) Queries in flight: 0 (0 queued)
[8a7e2454-d41c-4da2-81b2-7866763a6e0a] 2023-03-10T11:51:23+00:00 DEBUG metabase.server.middleware.log GET /api/database 200 10.8 ms (3 DB calls) App DB connections: 0/13 Jetty threads: 4/50 (7 idle, 0 queued) (77 total active threads) Queries in flight: 0 (0 queued)

Which makes no sense at all.

I changed the connection to use postgres user. Still fails.
Recreating the connection using postgres user works.
Recreating the connection using the same user that failed on the first connection works.

However! In the Metabase database, the dbms_version for that connection is empty as is the 'settings' text.
I copied values from the working connections, rebooted etc. Still doesn't work!

Any ideas?

Will pass this on to the team for us to look into it.

If I edit the database and set 'database-enable-actions' to true. It appear correctly but can't now be disabled!

I've copied the entries from the 'details' column to see if I can find any differences.
The first in this list is the old connection that doesn't work. Second is the one that allows me to change the selector (oddly, it's shorter).
I've removed the username and passwords:

[
	{
		"ssl-use-client-auth": false,
		"additional-options": null,
		"ssl": true,
		"password": "xyz",
		"let-user-control-scheduling": true,
		"port": 5432,
		"advanced-options": false,
		"schema-filters-type": "all",
		"dbname": "CarePlanner",
		"host": "localhost",
		"tunnel-enabled": false,
		"user": "xyz",
		"ssl-mode": "require"
	},
	{
		"ssl": true,
		"password": "xyz",
		"port": 5432,
		"advanced-options": false,
		"schema-filters-type": "all",
		"dbname": "CarePlanner",
		"host": "localhost",
		"tunnel-enabled": false,
		"user": "xyz"
	}
]

Interesting. Can you please turn it to false again in the DB and share any logs in your Javascript console when you try to enable it via the UI?

Very similar to before. I've left feedback on actions on a separate question. Let me know if I should post elsewhere.

[20c15d6d-72f7-4d1c-8255-0d162cf16fcc] 2023-03-13T10:36:33+00:00 INFO metabase.models.database :postgres Database 'CarePlanner Combined' sync/analyze schedules have changed! 
 Sync metadata was: '0 14 * * * ? *' is now: '0 39 * * * ? *' 
 Cache FieldValues was: '0 0 3 * * ? *', is now: '0 0 10 * * ? *'
[20c15d6d-72f7-4d1c-8255-0d162cf16fcc] 2023-03-13T10:36:33+00:00 INFO metabase.task.sync-databases Scheduling sync/analyze for database 5: trigger: metabase.task.sync-and-analyze.trigger.5
[20c15d6d-72f7-4d1c-8255-0d162cf16fcc] 2023-03-13T10:36:33+00:00 INFO metabase.task.sync-databases Scheduling field-values for database 5: trigger: metabase.task.update-field-values.trigger.5
[20c15d6d-72f7-4d1c-8255-0d162cf16fcc] 2023-03-13T10:36:33+00:00 DEBUG metabase.server.middleware.log PUT /api/database/5 200 50.2 ms (9 DB calls) App DB connections: 0/15 Jetty threads: 5/50 (4 idle, 0 queued) (123 total active threads) Queries in flight: 0 (0 queued)
[20c15d6d-72f7-4d1c-8255-0d162cf16fcc] 2023-03-13T10:36:33+00:00 DEBUG metabase.server.middleware.log GET /api/database 200 4.9 ms (3 DB calls) App DB connections: 0/15 Jetty threads: 5/50 (4 idle, 0 queued) (125 total active threads) Queries in flight: 0 (0 queued)```

Those are your Metabase logs. I'm looking for the logs in the browser, from developer tools. There is probably an API call failing, and the returned error would be helpful.

Which bit do you need?
In the network settings, I can see the api/database being called, but no errors.
In console, there's a load of errors on loading any database but after clearing that, clicking the button does nothing.

Only oddity I can see in the HTML source is that the non-working check has both aria-checked="true" checked="" (I've turned it on by editing the metabase database).
the other databases only have aria-checked="true".
No idea if that is relevant.

Yeah, I meant those tabs in the browser, and that's really odd. Let me chat with the team.

Quick update on this. I upgraded to the release version today. Still doesn't work. It's not a killer as we can still set the value in the database, just need to be aware of the problem.

1 Like

Not sure if I should just heart this issue, but I am getting the same issue (network call being issued, but actions not being enabled) on 1.46.1 too

which DB are you connecting to @timdumol @AndrewMBaines ?

I am connecting to an RDS PostgreSQL 14.3 instance using the root user

I'm on Postgres 14. It works on 3 connections, just one fails. Creating a new version of the connection works.