# SQL Error with \`screened\_ip\_addresses\` (API throws 500)

**URL:** <https://meta.discourse.org/t/sql-error-with-screened-ip-addresses-api-throws-500/146694>\
**Category:** Migration\
**Tags:** rest-api\
**Created:** [April 3, 2020, 12:37pm UTC](https://meta.discourse.org/t/sql-error-with-screened-ip-addresses-api-throws-500/146694 "2020-04-03T12:37:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)\
**Post date:** [April 3, 2020, 12:37pm UTC](https://meta.discourse.org/t/sql-error-with-screened-ip-addresses-api-throws-500/146694/1 "2020-04-03T12:37:26Z")

</div>

Hi friends,

The API is giving me an error 500 when I call to create a new post (in an existing topic). In the logs I see:

```plaintext
ActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR: invalid input syntax for type inet: ""
LINE 1: ..._addresses".* FROM "screened_ip_addresses" WHERE ('' <<= ip_...
                                                             ^
)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.0.1/lib/patches/db/pg.rb:69:in `exec_params'

Failed to handle exception in exception app middleware : PG::InvalidTextRepresentation: ERROR: invalid input syntax for type inet: ""
LINE 1: ..._addresses".* FROM "screened_ip_addresses" WHERE ('' <<= ip_...
                                                             ^

```

Here is my Screened IP list - in addition to the screen shot below, I have also whitelisted the IP for the machine that is calling the API. (I’m using a system-level API key to mass-import old topics/messages from my old forum software.)

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/5/55c97738623970e999cef3d0fe911cbd728d39e4.png)

Just for kicks, I also asked the API for the Screened IP list… same results. ([https://mydiscourse.com/admin/logs/screened\_ip\_addresses.json](https://mydiscourse.com/admin/logs/screened_ip_addresses.json))

I’m not sure what else to check. 🤷🏻‍♂️

**Anyone know:**

**1. What is causing this error, and**  
**2. How can I fix it now and prevent it from happening in the future?**

Help 🙂

 ![](https://global.discourse-cdn.com/meta/original/3X/5/4/54df6f6710a5bf46c387c0d03dd1e07526c2c15e.gif)

Thanks!

---

_[View the full topic](https://meta.discourse.org/t/sql-error-with-screened-ip-addresses-api-throws-500/146694)._
