Specific Subscription Email not working

Hello everyone,

I have a metabase instance installed in a docker container working flawlessly. I have somewhere around 8 dashboard reports sent to some emails working properly.

Now, i created a new report, and added it to a Dashboard and set up my subscription, but if i press "Send Email Now", or wait for the time for it to be sent, it won't. No matter if the report is sent as xlsx or csv. Same error appears.

I must insist that every other report is sent properly.

The log has the following error:

[04ffe323-388b-4e67-9aab-818a3d79ed6b] 2025-03-26T09:51:38-04:00 ERROR metabase.notification.send [Notification 22] Failed to send,java.lang.NullPointerException: Cannot invoke Object.getClass() because x is null, at clojure.lang.Numbers.ops(Numbers.java:1099), at clojure.lang.Numbers.isZero(Numbers.java:119), at metabase.formatter$number_formatter$fn__83186.invoke(formatter.clj:191), at metabase.channel.render.body$query_results__GT_row_seq95083__95085$iter__95089__95093$fn__95094$iter__95128__95132$fn__95133.invoke(body.clj:156), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.Cons.next(Cons.java:41), at clojure.lang.RT.countFrom(RT.java:673), at clojure.lang.RT.count(RT.java:663), at metabase.channel.render.table$render_table_body$iter__93214__93218$fn__93219$iter__93253__93257$fn__93258.invoke(table.clj:137), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.RT.seq(RT.java:555), at clojure.core$seq__5486.invokeStatic(core.clj:139), at clojure.core$map$fn__5954.invoke(core.clj:2763), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89)
[04ffe323-388b-4e67-9aab-818a3d79ed6b] 2025-03-26T09:51:38-04:00 ERROR metabase.pulse.send [Pulse 22] Error sending to email channel,java.lang.NullPointerException: Cannot invoke Object.getClass() because x is null, at clojure.lang.Numbers.ops(Numbers.java:1099), at clojure.lang.Numbers.isZero(Numbers.java:119), at metabase.formatter$number_formatter$fn__83186.invoke(formatter.clj:191), at metabase.channel.render.body$query_results__GT_row_seq95083__95085$iter__95089__95093$fn__95094$iter__95128__95132$fn__95133.invoke(body.clj:156), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.Cons.next(Cons.java:41), at clojure.lang.RT.countFrom(RT.java:673), at clojure.lang.RT.count(RT.java:663), at metabase.channel.render.table$render_table_body$iter__93214__93218$fn__93219$iter__93253__93257$fn__93258.invoke(table.clj:137), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.RT.seq(RT.java:555), at clojure.core$seq__5486.invokeStatic(core.clj:139), at clojure.core$map$fn__5954.invoke(core.clj:2763), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89)

And this is the Diagnostic Information

{
"browser-info": {
"language": "es-ES",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"metabase-info": {
"databases": [
"mysql"
],
"run-mode": "prod",
"plan-alias": "",
"version": {
"date": "2025-03-25",
"tag": "v0.53.8",
"hash": "e1eecad"
},
"settings": {
"report-timezone": "America/Caracas"
},
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "16.4 (Debian 16.4-1.pgdg120+1)"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.7.4"
}
}
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "21.0.6+7-LTS",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "21.0.6",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "21.0.6+7-LTS",
"os.name": "Linux",
"os.version": "5.15.0-134-generic",
"user.language": "en",
"user.timezone": "GMT"
}
}

Thanks in advance.

Hey there!

Based on the error, it would seem like something is causing a null pointer when formatting a table question in that dashboard. Could you try the following steps?

  • Clearing the dashboard or creating a new empty one
  • Add questions one by one to the dashboard and test sending the email at each step to diagnose which specific question causes the error.
  • If you found the question, try removing all column formatting options and then adding them back until you find out if there's a particular formatting option causing the error.

Please share your findings here! :slight_smile:

Hi Marcos and thanks for taking the time to answer my question.

  1. I sent the dashboard to the recycle bin.
  2. I created a new dashboard with a different name
  3. I added the question i need to send to the dashboard
  4. Saved the dashboard
  5. Subscribed to it
  6. Tried to send it and the same thing happens
[04ffe323-388b-4e67-9aab-818a3d79ed6b] 2025-03-26T15:40:42-04:00 ERROR metabase.notification.send [Notification 23] Failed to send,java.lang.NullPointerException: Cannot invoke Object.getClass() because x is null, at clojure.lang.Numbers.ops(Numbers.java:1099), at clojure.lang.Numbers.isZero(Numbers.java:119), at metabase.formatter$number_formatter$fn__83186.invoke(formatter.clj:191), at metabase.channel.render.body$query_results__GT_row_seq95083__95085$iter__95089__95093$fn__95094$iter__95128__95132$fn__95133.invoke(body.clj:156), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.Cons.next(Cons.java:41), at clojure.lang.RT.countFrom(RT.java:673), at clojure.lang.RT.count(RT.java:663), at metabase.channel.render.table$render_table_body$iter__93214__93218$fn__93219$iter__93253__93257$fn__93258.invoke(table.clj:137), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.RT.seq(RT.java:555), at clojure.core$seq__5486.invokeStatic(core.clj:139), at clojure.core$map$fn__5954.invoke(core.clj:2763), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89)
[04ffe323-388b-4e67-9aab-818a3d79ed6b] 2025-03-26T15:40:42-04:00 ERROR metabase.pulse.send [Pulse 23] Error sending to email channel,java.lang.NullPointerException: Cannot invoke Object.getClass() because x is null, at clojure.lang.Numbers.ops(Numbers.java:1099), at clojure.lang.Numbers.isZero(Numbers.java:119), at metabase.formatter$number_formatter$fn__83186.invoke(formatter.clj:191), at metabase.channel.render.body$query_results__GT_row_seq95083__95085$iter__95089__95093$fn__95094$iter__95128__95132$fn__95133.invoke(body.clj:156), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.Cons.next(Cons.java:41), at clojure.lang.RT.countFrom(RT.java:673), at clojure.lang.RT.count(RT.java:663), at metabase.channel.render.table$render_table_body$iter__93214__93218$fn__93219$iter__93253__93257$fn__93258.invoke(table.clj:137), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89), at clojure.lang.LazySeq.seq(LazySeq.java:106), at clojure.lang.RT.seq(RT.java:555), at clojure.core$seq__5486.invokeStatic(core.clj:139), at clojure.core$map$fn__5954.invoke(core.clj:2763), at clojure.lang.LazySeq.force(LazySeq.java:50), at clojure.lang.LazySeq.realize(LazySeq.java:89)

I removed the question and started over again.

I added all my fields, added the question to a dashboard, and could send it once. But then, i modified adding a text field from another table (notice i never add it before initiating the post) and the problem started again. Now the error is:

[04ffe323-388b-4e67-9aab-818a3d79ed6b] 2025-03-26T16:46:05-04:00 ERROR metabase.notification.send [Notification 25] Failed to send,java.lang.NullPointerException
[04ffe323-388b-4e67-9aab-818a3d79ed6b] 2025-03-26T16:46:05-04:00 ERROR metabase.pulse.send [Pulse 25] Error sending to email channel,java.lang.NullPointerException

So, i guess i'll have to try creating the query one time and if it works, not touch it ever again.

I'll keep trying to solve it. Thanks a lot for pointing me in the right direction.

I think i got it, but seems strange to me.

One of my tables has a column named COST. Is just a number that reflects how much a product costs.

The table has some values with zero as value.

I had to modify the column in the query to this:

if ( [Cost] = 0, -1, [Cost] )

Now the email goes out properly.

If this is not a bug, well, no clue what it is.

I'm glad you could pinpoint the issue!
It does seem like a bug. To report it properly we would need a way for anyone to reproduce it. Maybe there's something about the column, could you tell me what the underlying DB type of that Cost column is, if there are any column settings set, and what shows up on that column on the Admin Settings -> Table Metadata section?

Well, the database i'm using is MySQL

The column is defined in the database as decimal(15,4)

The column metadata specifies:

Original Schema: type/Decimal
Columns: it had the COST (Financial) definition before. I changed it to No semantic type
It gave the error either way.

No conversion and the value shown is the original value.

(Metadata Settings - General and Format)


Thanks a lot for your help on this.

Had no luck reproducing this, could you tell me:

  • MySQL version you're using, and where it's running (RDS, Hostinger, etc)
  • Any special params on its connection string if present
  • If this bug also happens when you add another column of the same DB type and it has zeroes in it, or if it's special for this particular column
  • If you try and reproduce this with any table from the Sample Database with numeric columns, does it work normally?

Hello Marcos.

Im on MySQL 5.7 running in a docker container on a Linode instance.

The MySQL Server and the metabase instance connect to each other locally, without going out to the internet vía private IPs in both instances.

There are no special parameters on the connection string. Just server ip, user name, password

No, the error seemed to be on the table that has that value. (i'll explan why in past)

Reproduction, tried this way and could not do it:

  1. I created another table called temporary
  2. I added all 3.251.676 records to it
  3. Created a new question joining with another required table, and tried to calculate the same value using the Cost column and also using the same filters,
  4. Created a new dashboard for the question
  5. Tried to send the email 5 times changing columns, order, date, and it sent it correctly every time.

So, i guess there's something odd with the original table or i'm not hitting the right spot on this new question/dashboard.

I'm going to keep going business as usual and maybe this weekend i'm going to recreate and repopulate the table to see what happens. Anyway, the if instruction saved the day

Thanks again for all your time invested on this.