Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start failed - sonyflake not created #124

Open
carrey-k opened this issue Jun 13, 2022 · 2 comments
Open

Start failed - sonyflake not created #124

carrey-k opened this issue Jun 13, 2022 · 2 comments

Comments

@carrey-k
Copy link

carrey-k commented Jun 13, 2022

make start

panic: sonyflake not created

goroutine 1 [running]:
github.com/LyricTian/gin-admin/v8/pkg/util/snowflake.init.0()
	gin-admin/pkg/util/snowflake/snowflake.go:16 +0xe5
exit status 2
make: *** [start] Error 1

Go version

go version go1.16.15 darwin/amd64
@carrey-k carrey-k changed the title Start failed Start failed - sonyflake not created Jun 13, 2022
@Conight
Copy link
Contributor

Conight commented Jun 15, 2022

Change this line and print error detail to console to see that happened.

panic("sonyflake not created")

@mlsjla
Copy link

mlsjla commented Aug 20, 2022

我这边也遇到过, 大概是不支持部分内网段IP导致的。

func isPrivateIPv4(ip net.IP) bool { return ip != nil && (ip[0] == 10 || ip[0] == 172 && (ip[1] >= 16 && ip[1] < 32) || ip[0] == 192 && ip[1] == 168) }

解决办法,使用自定义获取机器码

getMachineID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants