'Invalid input syntax for type inet' db error in Django app with postgres and Gunicorn+Nginx as reverse proxy

前端 未结 3 854
小鲜肉
小鲜肉 2020-12-22 02:22

Can you help me decipher this rather esoteric error? Everything\'s fine when I fire up the application, but crashes the moment I try to login.

3条回答
  •  隐瞒了意图╮
    2020-12-22 02:56

    Your program is trying to add a row to some logging table with empty remote IP. I suppose that when you use reverse proxy the program doesn't know the remote IP, as it's shadowed by proxy's IP.

    As it's empty I suppose the program is trying to ignore proxy's IP, but it does not find any better. It should use X-Forwarded-For header.

    If there's no reasonable IP to log, the program should simply log "NULL" as the IP.

提交回复
热议问题