<?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: Errors have become less informative in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251773#M9125</link>
    <description>&lt;P&gt;Just tested it, yep, exact same issue.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jun 2025 12:36:04 GMT</pubDate>
    <dc:creator>the_rock</dc:creator>
    <dc:date>2025-06-23T12:36:04Z</dc:date>
    <item>
      <title>Errors have become less informative</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251699#M9120</link>
      <description>&lt;P&gt;I haven't been able to find an error schema anywhere, so I'm in the process of collecting tons of exemplars from different versions. I noticed today that if you specify a bogus domain when logging in on R80.10, it gives you a 400 status code with this body:&lt;/P&gt;
&lt;P&gt;{"code":"generic_error","message":"Runtime error: Domain 'BogusDomain' not found!"}&lt;/P&gt;
&lt;P&gt;Make exactly the same API call on R82 and it gives you a 400 with this body:&lt;/P&gt;
&lt;P&gt;{"code":"err_login_failed","message":"Authentication to server failed."}&lt;/P&gt;
&lt;P&gt;But it gets worse! When you specify the call against the R82 system should be run in APIv1.1 (R80.10's API version), it still returns R82's less helpful error!&lt;/P&gt;
&lt;P&gt;To be clear: it looks like making a call against a previous API version does not ensure the call is processed the way the previous version processed it.&lt;/P&gt;
&lt;P&gt;If anybody would like to reproduce this independently, here's the code I'm using:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;apiVersions=("v1" "v1.1" "v1.2" "v1.3" "v1.4" "v1.5" "v1.6" "v1.6.1" "v1.7" "v1.7.1" "v1.8" "v1.8.1" "v1.9" "v1.9.1" "v2" "")
testBody='{"user":"PasswordUser","password":"1qaz!QAZ","domain":"BogusDomain"}'
for apiVersion in "${apiVersions[@]}";do
curl -ksv "https://${server}/web_api/${apiVersion:+/$apiVersion}/login" \
-H "Content-Type:application/json" -d "${testBody}" &amp;gt;curlOut 2&amp;gt;curlErr
&amp;lt;curlErr egrep "^(&amp;lt; HTTP|[^&amp;lt;&amp;gt;*])" \
| egrep -v "^([{}] \[|  Trying)" \
| sed -r 's@&amp;lt; HTTP/1.1 ([0-9]+) .+@(\1, Data("""@'
&amp;lt;curlOut jq -c .
echo -n '""".utf8)),'
echo -e "\t// API${apiVersion:- default version}"
echo ""
done
rm curlErr curlOut&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Jun 2025 22:53:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251699#M9120</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2025-06-20T22:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Errors have become less informative</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251713#M9121</link>
      <description>&lt;P&gt;100% agreed, at least when using tools like &lt;STRONG&gt;mgmt_cli&lt;/STRONG&gt;&amp;nbsp;to make calls it will generally catch most syntax errors and give you some idea what is wrong.&amp;nbsp; But once you start making direct web API calls all bets are off. The only generic errors returned (with no additional details about the issue returned) for direct API calls are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;generic_err_invalid_syntax (this one is the real killer)&lt;/LI&gt;
&lt;LI&gt;generic_err_session_expired&lt;/LI&gt;
&lt;LI&gt;generic_err_wrong_session_id&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;When teaching CCAS R81.20 on many occasions there will be a syntax error with a direct API call, and the only way to figure out what is wrong is to look at&amp;nbsp;$FWDIR/log/api.elg or&amp;nbsp;/var/log/gaia_api_server.log, and in rare cases $FWDIR/log/cpm.elg when the call makes it through the API server but then fails when executed by cpm.&lt;/P&gt;
&lt;P&gt;Perhaps useful error messages are being restricted for a session that is not authenticated yet for "security reasons"?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2025 13:30:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251713#M9121</guid>
      <dc:creator>Timothy_Hall</dc:creator>
      <dc:date>2025-06-21T13:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Errors have become less informative</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251735#M9123</link>
      <description>&lt;P&gt;I will try test this in my R82 lab Monday.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jun 2025 22:41:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251735#M9123</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-06-22T22:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Errors have become less informative</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251773#M9125</link>
      <description>&lt;P&gt;Just tested it, yep, exact same issue.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 12:36:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251773#M9125</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-06-23T12:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Errors have become less informative</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251790#M9126</link>
      <description>&lt;P&gt;I get it, since telling someone that 2 out of 3 parts of their login request are correct narrows the problem space for an attacker.&lt;/P&gt;
&lt;P&gt;That said, errors are part of an API contract. Changing them without changing the version number makes version numbers worthless. There are now at least two incompatible versions of the management API which both call themselves "v1.1".&lt;/P&gt;
&lt;P&gt;The right approach would have been to stop claiming to support version 1.1 when the errors were changed.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 16:23:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/251790#M9126</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2025-06-23T16:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Errors have become less informative</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/253856#M9154</link>
      <description>&lt;P&gt;Checked the login to a Bogus Domain with a Python script on R81.20 and R82 both with the recommended HF versions. It seems to be uniform responses now, except API version 1:&lt;/P&gt;
&lt;P&gt;Here is R81.20:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Checked all suppported API versions on HOTFIX_R81_20_JUMBO_HF_MAIN Take: 105:

+---------+-------------+------------------+----------------------------------+
| Version | Status Code |       Code       |             Message              |
+---------+-------------+------------------+----------------------------------+
|    1    |     500     |  generic_error   | Authentication to server failed. |
|   1.1   |     400     | err_login_failed | Authentication to server failed. |
|   1.2   |     400     | err_login_failed | Authentication to server failed. |
|   1.3   |     400     | err_login_failed | Authentication to server failed. |
|   1.4   |     400     | err_login_failed | Authentication to server failed. |
|   1.5   |     400     | err_login_failed | Authentication to server failed. |
|   1.6   |     400     | err_login_failed | Authentication to server failed. |
|  1.6.1  |     400     | err_login_failed | Authentication to server failed. |
|   1.7   |     400     | err_login_failed | Authentication to server failed. |
|  1.7.1  |     400     | err_login_failed | Authentication to server failed. |
|   1.8   |     400     | err_login_failed | Authentication to server failed. |
|  1.8.1  |     400     | err_login_failed | Authentication to server failed. |
|   1.9   |     400     | err_login_failed | Authentication to server failed. |
|  1.9.1  |     400     | err_login_failed | Authentication to server failed. |
+---------+-------------+------------------+----------------------------------+

Default API version: 1.9.1&lt;/LI-CODE&gt;
&lt;P&gt;...and R82:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Checked all suppported API versions on HOTFIX_R82_JUMBO_HF_MAIN Take: 33:

+---------+------------------+------------------+----------------------------------+
| Version | HTTP Status Code |    Error Code    |          Error Message           |
+---------+------------------+------------------+----------------------------------+
|    1    |       500        |  generic_error   | Authentication to server failed. |
|   1.1   |       400        | err_login_failed | Authentication to server failed. |
|   1.2   |       400        | err_login_failed | Authentication to server failed. |
|   1.3   |       400        | err_login_failed | Authentication to server failed. |
|   1.4   |       400        | err_login_failed | Authentication to server failed. |
|   1.5   |       400        | err_login_failed | Authentication to server failed. |
|   1.6   |       400        | err_login_failed | Authentication to server failed. |
|  1.6.1  |       400        | err_login_failed | Authentication to server failed. |
|   1.7   |       400        | err_login_failed | Authentication to server failed. |
|  1.7.1  |       400        | err_login_failed | Authentication to server failed. |
|   1.8   |       400        | err_login_failed | Authentication to server failed. |
|  1.8.1  |       400        | err_login_failed | Authentication to server failed. |
|   1.9   |       400        | err_login_failed | Authentication to server failed. |
|  1.9.1  |       400        | err_login_failed | Authentication to server failed. |
|    2    |       400        | err_login_failed | Authentication to server failed. |
+---------+------------------+------------------+----------------------------------+

Default API version: 2&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 08:57:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Errors-have-become-less-informative/m-p/253856#M9154</guid>
      <dc:creator>Daniel_Kuhl1</dc:creator>
      <dc:date>2025-07-24T08:57:23Z</dc:date>
    </item>
  </channel>
</rss>

