# Invalid input for update\_ip\_address

**URL:** https://meta.discourse.org/t/invalid-input-for-update-ip-address/77085
**Category:** Self-hosting
**Created:** [1월 2, 2018, 6:11오전 UTC](https://meta.discourse.org/t/invalid-input-for-update-ip-address/77085 "2018-01-02T06:11:15Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![klopsknoedel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klopsknoedel/32/194126_2.png) [@klopsknoedel](https://meta.discourse.org/u/klopsknoedel)
#### Post date: [7월 11, 2019, 2:12오전 UTC](https://meta.discourse.org/t/invalid-input-for-update-ip-address/77085/17 "2019-07-11T02:12:45Z")

</div>

> [@kierandelaney](#):
>
> Pricing is far more complicated (Microsoft give with one hand, they will always take with the other) but for us, so far, the bills have been the same or lower.

Lucky you. Because of the higher cost we needed to switch back to SKU V1 as soon as the V2 preview has ended.

Anyway, it seems that this issue/case has already been addressed upstream by [a merged PR](https://github.com/rack/rack/pull/1251) and should be included since rack 2.0. But according to [this issue](https://github.com/rack/rack/issues/1322) it is still missing in the current releases.

Temporarily I apply a patch during CI/CD to handle this issue. It’s not that great but it will do the job until we see the fix in an upcoming rack-/discourse-release.

If anyone is interested, that’s the part you need to change to get rid of the extra port in `lib/auth/default_current_user_provider.rb`:

```plaintext
if current_user && should_update_last_seen?
  u = current_user
  ip_port_split = request.ip.split(':')
  ip_only = ip_port_split.first
  Scheduler::Defer.later "Updating Last Seen" do
    u.update_last_seen!
    u.update_ip_address!(ip_only)
  end
end

```

I don’t know if it is a good idea to replace any occurrence of `request.ip` with this quickfix anywhere else in that file or others (email\_controller.rb, 006-mini\_profiler.rb, request\_tracker.rb) but it works for us.  
As said, applying it as a patch during your build-/CI-processes keeps the code-base clean and updatable.

Any “prettier” solution is welcome.

---

_[View the full topic](https://meta.discourse.org/t/invalid-input-for-update-ip-address/77085)._
