wuchunfu / IpProxyPool

Golang 实现的 IP 代理池, 涉及到的技术点: go gorm proxy proxypool ip crawler 爬虫 mysql viper cobra
Apache License 2.0
104 stars 32 forks source link

Panic #16

Open SuvanCheng opened 3 years ago

SuvanCheng commented 3 years ago

INFO[0006]/Users/allen/go/src/github.com/IpProxyPool/fetcher/fetcher.go:17 github.com/wuchunfu/IpProxyPool/fetcher.Fetch() Fetch url: http://www.66ip.cn/100.html
INFO[0006]/Users/allen/go/src/github.com/IpProxyPool/fetcher/ip66/ip66.go:47 github.com/wuchunfu/IpProxyPool/fetcher/ip66.Ip66() [66ip] fetch done
INFO[0006]/Users/allen/go/src/github.com/IpProxyPool/run/run.go:64 github.com/wuchunfu/IpProxyPool/run.run() All getters finished.
ERRO[0007]/Users/allen/go/src/github.com/IpProxyPool/models/ipModel/ipModel.go:44 github.com/wuchunfu/IpProxyPool/models/ipModel.GetIpByProxyHost() get ip: , error msg: Error 1146: Table 'proxypool.proxy_ip' doesn't exist ERRO[0007]/Users/allen/go/src/github.com/IpProxyPool/models/ipModel/ipModel.go:44 github.com/wuchunfu/IpProxyPool/models/ipModel.GetIpByProxyHost() get ip: , error msg: Error 1146: Table 'proxypool.proxy_ip' doesn't exist panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x15347b2]

goroutine 75 [running]: github.com/wuchunfu/IpProxyPool/models/ipModel.SaveIp(0xc000496680) /Users/allen/go/src/github.com/IpProxyPool/models/ipModel/ipModel.go:26 +0x72 github.com/wuchunfu/IpProxyPool/middleware/storage.CheckProxy(0xc000496680) /Users/allen/go/src/github.com/IpProxyPool/middleware/storage/filter.go:21 +0x4a github.com/wuchunfu/IpProxyPool/run.Task.func2(0xc000297920) /Users/allen/go/src/github.com/IpProxyPool/run/run.go:26 +0x4c created by github.com/wuchunfu/IpProxyPool/run.Task /Users/allen/go/src/github.com/IpProxyPool/run/run.go:24 +0x89 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x15347b2]

goroutine 69 [running]: github.com/wuchunfu/IpProxyPool/models/ipModel.SaveIp(0xc000323580) /Users/allen/go/src/github.com/IpProxyPool/models/ipModel/ipModel.go:26 +0x72 github.com/wuchunfu/IpProxyPool/middleware/storage.CheckProxy(0xc000323580) /Users/allen/go/src/github.com/IpProxyPool/middleware/storage/filter.go:21 +0x4a github.com/wuchunfu/IpProxyPool/run.Task.func2(0xc000297920) /Users/allen/go/src/github.com/IpProxyPool/run/run.go:26 +0x4c created by github.com/wuchunfu/IpProxyPool/run.Task /Users/allen/go/src/github.com/IpProxyPool/run/run.go:24 +0x89

wuchunfu commented 3 years ago

Please create related database tables in the database docs/db/mysql.sql

wuchunfu commented 3 years ago

Thank you for your use, please give a star.