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

[debug]二进制包运行报错&获取到的总是内网IP #366

Open
ericzhang-debug opened this issue Nov 22, 2022 · 5 comments
Open

[debug]二进制包运行报错&获取到的总是内网IP #366

ericzhang-debug opened this issue Nov 22, 2022 · 5 comments
Labels

Comments

@ericzhang-debug
Copy link

ericzhang-debug commented Nov 22, 2022

描述问题 (Describe the bug)

版本信息 (version info)

  • DDNS Version: 2.11.5
  • OS Version: Windows 11 Professional 22H2
  • Type(运行方式): Python3
  • related issues (相关问题):

复现步骤 (To Reproduce)

完全按照官方的方法使用

配置文件 (config file)

{
{
  "$schema": "https://ddns.newfuture.cc/schema/v2.8.json",
  "debug": true,
  "dns": "alidns",
  "id": "LTAI5tKjSh3kFuqm@@@@@@@@",
  "index4": "default",
  "index6": "default",
  "ipv4": [
    "ipv4.ddns.**ver.cn"
  ],
  "ipv6": [
    "ipv6.ddns.**ver.cn"
  ],
  "proxy": null,
  "token": "Y@@@@@@@@Ymf27XogEGhzHUGkTKwjH",
  "ttl": null
}
}

调试输出 (debug output)

!!!这是用的二进制打包的文件直接运行!!!
PS C:\Users\Eric\Desktop\DDNS> .\ddns.exe
2022-11-22 22:58:58,348 <cache.load> 48@util\cache.py
[DEBUG] load cache data from C:\Users\Eric\AppData\Local\Temp\ddns.cache
Traceback (most recent call last):
  File "run.py", line 159, in <module>
  File "run.py", line 151, in main
  File "run.py", line 99, in update_ip
  File "run.py", line 66, in get_ip
  File "util\ip.py", line 31, in default_v6
OSError: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。
[3792] Failed to execute script 'run' due to unhandled exception!
DDNS[ v2.11.5@2022-07-28T14:50:06+00:00 ] run: nt win32
Configuration was loaded from <== C:\Users\Eric\Desktop\DDNS\config.json
========================= Tue Nov 22 22:58:58 2022 =========================
. Traceback (most recent call last):
  File "<string>", line 1, in <module>
ValueError: underlying buffer has been detached
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ValueError: underlying buffer has been detached

补充说明 (Additional context)

源码运行正常,但是必须要管理员身份
获取到的总是内网IP 10.X.X.X

Configuration was loaded from <== C:\Users\Eric\Desktop\DDNS\DDNS-master\config.json
========================= Tue Nov 22 23:12:55 2022 =========================
. .
PS C:\Users\Eric\Desktop\DDNS\DDNS-master>
@ericzhang-debug ericzhang-debug changed the title [debug] [debug]二进制包运行报错 Nov 22, 2022
@ericzhang-debug ericzhang-debug changed the title [debug]二进制包运行报错 [debug]二进制包运行报错&获取到的总是内网IP Nov 22, 2022
@laozhoubuluo
Copy link
Contributor

laozhoubuluo commented Nov 26, 2022

请按照以下代码修改 config.json 配置文件即可解决:

{
...
  "index4": "url:https://myip4.ipip.net/",
  "index6": "url:https://myip6.ipip.net/",
...
}

@izwb003
Copy link

izwb003 commented Nov 26, 2022

请按照以下代码修改 config.json 配置文件即可解决:

{
...
  "index4": "url:https://myip4.ipip.net/",
  "index6": "url:https://myip6.ipip.net/",
...
}

该方法不是使用外部公网地址API得到的IP吗?
若不希望访问外部API,而使用网卡IP(即“default”),如何解决该错误?

@laozhoubuluo
Copy link
Contributor

请按照以下代码修改 config.json 配置文件即可解决:

{
...
  "index4": "url:https://myip4.ipip.net/",
  "index6": "url:https://myip6.ipip.net/",
...
}

该方法不是使用外部公网地址API得到的IP吗? 若不希望访问外部API,而使用网卡IP(即“default”),如何解决该错误?

如果机器所在的网络不支持 IPv6 (机器的 IPv6 没有默认网关),那 index6 应该配置为 false 。

{
...
  "index4": "default",
  "index6": false,
...
}

@izwb003
Copy link

izwb003 commented Nov 27, 2022

请按照以下代码修改 config.json 配置文件即可解决:

{
...
  "index4": "url:https://myip4.ipip.net/",
  "index6": "url:https://myip6.ipip.net/",
...
}

该方法不是使用外部公网地址API得到的IP吗? 若不希望访问外部API,而使用网卡IP(即“default”),如何解决该错误?

如果机器所在的网络不支持 IPv6 (机器的 IPv6 没有默认网关),那 index6 应该配置为 false 。

{
...
  "index4": "default",
  "index6": false,
...
}

不是,目前情况是这样:
设备支持IPv6,个人理解index6配置为"default",程序会获取网卡的IP来更新。
而目前的情况是,index6配置为"default",运行程序便会卡出该issue所述的错误输出。
设备的IPv6配置应当没有问题,可以正常获取IPv6地址并访问IPv6网络。

@laozhoubuluo
Copy link
Contributor

请按照以下代码修改 config.json 配置文件即可解决:

{
...
  "index4": "url:https://myip4.ipip.net/",
  "index6": "url:https://myip6.ipip.net/",
...
}

该方法不是使用外部公网地址API得到的IP吗? 若不希望访问外部API,而使用网卡IP(即“default”),如何解决该错误?

如果机器所在的网络不支持 IPv6 (机器的 IPv6 没有默认网关),那 index6 应该配置为 false 。

{
...
  "index4": "default",
  "index6": false,
...
}

不是,目前情况是这样: 设备支持IPv6,个人理解index6配置为"default",程序会获取网卡的IP来更新。 而目前的情况是,index6配置为"default",运行程序便会卡出该issue所述的错误输出。 设备的IPv6配置应当没有问题,可以正常获取IPv6地址并访问IPv6网络。

可以试试按照 #373 改下文件,完了本地拉个 Python 环境跑一下试试。

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

No branches or pull requests

3 participants