dwyl / dwyl/hits

BUG: IP Address Formatting in DB

Open
#153 10 comments 0 reactions 0 assignees View on GitHub
bug chore help wanted priority-1 T2h technical
Dominant language
Elixir
Stars
451
Forks
63
Avg merge
1d 8h
Merged PRs (30d)
1

Description

On our catch up call, @SimonLab noted that the IP addresses are not being stored correctly.

```sh
flyctl postgres connect -a hits-db
```

```sh
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
0.0.0.0.0.65535.47400.59506
--More--
```

Ref: https://en.wikipedia.org/wiki/0.0.0.0

![image](https://user-images.githubusercontent.com/194400/157851670-8512dbeb-cc8e-4009-adab-ceefd2cedda3.png)

I suspect this might be a Fly.io thing ...

# Todo

+ [ ] Investigate why the IP addresses aren't being stored correctly by _briefly_ logging them to `sdout` (`IO.inspect`) so that we can simply tail the logs and see if the issue is at the database level.
+ [ ] Report back your findings!

Contributor guide

Open the contributing guide

Research direction

Start with the `flyctl postgres connect -a hits-db` entry point to inspect the stored values, then add the requested brief `IO.inspect` logging before persistence and tail the logs. Done means reporting whether the malformed IP address is produced before reaching the database or introduced at the database level.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, postgresql
Domain
backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.