<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there any way to propagate errors from dbutils? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18211#M12045</link>
    <description>&lt;P&gt;I have the same issue. I see no reason that Databricks couldn't propagate the internal exception back through their WorkflowException&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 20:34:00 GMT</pubDate>
    <dc:creator>wdphilli</dc:creator>
    <dc:date>2022-10-18T20:34:00Z</dc:date>
    <item>
      <title>Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18204#M12038</link>
      <description>&lt;P&gt;I have a master notebook that runs a few different notebooks on a schedule using the dbutils.notebook.run() function. Occasionally, these child notebooks will fail (due to API connections or whatever). My issue is, when I attempt to catch the errors with:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;try:
    dbutils.notebook.run(notebook_path, timeout_seconds=0)
except Exception as e:
    print(e)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The error is always the same regardless of the notebook/failure point: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;An error occurred while calling o8701._run.\n: com.databricks.WorkflowException: com.databricks.NotebookExecutionException: FAILED\n\tat com.databricks.workflow.WorkflowDriver.run(WorkflowDriver.scala:98)\n\tat com.databricks.dbutils_v1.impl.NotebookUtilsImpl.run(NotebookUtilsImpl.scala:134)\n\tat com.databricks.dbutils_v1.impl.NotebookUtilsImpl._run(NotebookUtilsImpl.scala:96)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)\n\tat py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:380)\n\tat py4j.Gateway.invoke(Gateway.java:295)\n\tat py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)\n\tat py4j.commands.CallCommand.execute(CallCommand.java:79)\n\tat py4j.GatewayConnection.run(GatewayConnection.java:251)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.databricks.NotebookExecutionException: FAILED\n\tat com.databricks.workflow.WorkflowDriver.run0(WorkflowDriver.scala:146)\n\tat com.databricks.workflow.WorkflowDriver.run(WorkflowDriver.scala:93)\n\t... 13 more\n&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It would be useful to capture the actual error that occurred in the notebook, rather than the one that just indicates that it failed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand I could catch any exceptions and propagate them using the dbutils.notebook.exit() function, but I'd rather not have to wrap every potential issue in a try-except. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a better way to capture the errors that occur in a child notebook? &lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 20:18:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18204#M12038</guid>
      <dc:creator>cvantassel</dc:creator>
      <dc:date>2022-06-08T20:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18205#M12039</link>
      <description>&lt;P&gt;May I suggest another way of working?&lt;/P&gt;&lt;P&gt;You could use workflows or schedule the notebooks in Glue/Data Factory.&lt;/P&gt;&lt;P&gt;The difference is that not all the notebooks run on the same cluster (compared to your setup).&lt;/P&gt;&lt;P&gt;I don´t know if that is an option?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 08:02:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18205#M12039</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2022-06-09T08:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18206#M12040</link>
      <description>&lt;P&gt;Thanks for your suggestion, @werners, but that unfortunately won't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We originally did have our jobs all scheduled separately, but the growing number of them made things messy since you need to click through the UI to find the jobs, then again to find the errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We're now trying to build a framework that can log runs into a table automatically so we can have all that information in one place. It would be mighty helpful if we could also capture what errors occurred so we can recognize the type of error without needing to sift though the UI.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 16:26:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18206#M12040</guid>
      <dc:creator>cvantassel</dc:creator>
      <dc:date>2022-06-09T16:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18207#M12041</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you try to use a custom logger to capture these error message?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 18:34:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18207#M12041</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-07-29T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18208#M12042</link>
      <description>&lt;P&gt;Hey there @Caleb Van Tassel​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 15:04:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18208#M12042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-16T15:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18209#M12043</link>
      <description>&lt;P&gt;A custom logger would work, but we were hoping for a solution that didn't require us to write specific code in every notebook since the scheduler will be used across teams.  &lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:07:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18209#M12043</guid>
      <dc:creator>cvantassel</dc:creator>
      <dc:date>2022-08-17T14:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18210#M12044</link>
      <description>&lt;P&gt;Unfortunately, we haven't been able to resolve this. It seems like we're stuck either manually clicking through notebooks, or specifically writing code every time we want an error to persist. Is there a place I can make a feature request? It would be very helpful if Databricks supported catching specific errors in notebooks using dbutils, rather than just throwing the placeholder WorkflowException.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:12:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18210#M12044</guid>
      <dc:creator>cvantassel</dc:creator>
      <dc:date>2022-08-17T14:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to propagate errors from dbutils?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18211#M12045</link>
      <description>&lt;P&gt;I have the same issue. I see no reason that Databricks couldn't propagate the internal exception back through their WorkflowException&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:34:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-any-way-to-propagate-errors-from-dbutils/m-p/18211#M12045</guid>
      <dc:creator>wdphilli</dc:creator>
      <dc:date>2022-10-18T20:34:00Z</dc:date>
    </item>
  </channel>
</rss>

