SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
19.58k stars 2.33k forks source link

Cannot create a file when that file already exists. #716

Closed hosseinkhojany closed 1 year ago

hosseinkhojany commented 1 year ago

Welcome

Description of the problem

Network adapter interface not generating in windows 10 , 8 ,7 but it work correctly in windows 11

After the below error is printed, if you try again, singbox making the adapter successfully, but it takes about 15 seconds to print this error

SingBox FATAL[0016] start service: initialize inbound/tun[tun-in]: configure tun interface: Cannot create a file when that file already exists.

Version of sing-box

```console $ sing-box version sing-box version 1.3-beta11 Environment: go1.20.3 windows/amd64 Tags: with_gvisor,with_quic,with_wireguard,with_utls,with_reality_server,with_clash_api Revision: e02317a34851617c0eb2cb6634b4b62901aa04dc CGO: disabled ```

Server and client configuration file

```console # asdg ```

Server and client log file

```console # dsafsadg ```
hosseinkhojany commented 1 year ago

I tested on last major but have this issue

hosseinkhojany commented 1 year ago

I found a solution for this, changing the interface_name solves the problem, you just need to change the interface_name every time, before starting the tunnel.

Sp1ke47 commented 1 year ago

Same for most GUI clients using singbox as core like NekoRay and V2rayN. In some situations like startup after a former accidental quit, the previous network interface isn't removed automatically. Sometimes more restarts are needed do the trick.

zhouxinghong commented 1 year ago

I found a solution for this, changing the interface_name solves the problem, you just need to change the interface_name before starting the tunnel.

May I ask which interface name needs to be modified, for example: V2rayN tool

zhouxinghong commented 1 year ago

This error occurs very frequently in clients.

Totoro-Li commented 1 year ago

Any progress on this? More than 1 month and this issue gets reflected in all downstream proxy projects.

hosseinkhojany commented 1 year ago

@zhouxinghong interface_name in the singbox config https://sing-box.sagernet.org/configuration/inbound/tun/#interface_name

zhouxinghong commented 1 year ago

@zhouxinghong interface_name in the singbox config https://sing-box.sagernet.org/configuration/inbound/tun/#interface_name

Thank you very much! 👍

Zhopeful88 commented 1 year ago

@zhouxinghong interface_name in the singbox config https://sing-box.sagernet.org/configuration/inbound/tun/#interface_name

I can not find the config on sinbox folder,and it should be on the where folder?

hosseinkhojany commented 1 year ago

What client are you using? @Zhopeful88

Zhopeful88 commented 1 year ago

What client are you using? @Zhopeful88

Windows /V2RyaN ,if not use the Tun,WhatsApp can not chat,if open the tun,WhatsApp was ok,but ins , fb and other many website can''t open,I test just amazon and other one could be open (had not test more)

Zhopeful88 commented 1 year ago

What client are you using? @Zhopeful88

I had find config.json files,but can't modification the name,like me change the name like the "*-tun1",but if I open the Tun model,the name will be changed the "**-tun"

hosseinkhojany commented 1 year ago

why not start singbox manually with cmd in windows ? singbox.exe run -c config.json

Zhopeful88 commented 1 year ago

Had test,this will appear on next time

hosseinkhojany commented 1 year ago

You have to change the interface_name each time If you are familiar with Python or any scripting language, you can easily write a program that automatically changes the interface_name every time.

Zhopeful88 commented 1 year ago

You have to change the interface_name each time If you are familiar with Python or any scripting language, you can easily write a program that automatically changes the interface_name every time.

I just have the VS IDE,but if I change the name on the congfig files ,Tun on TUN,the name will reset

Zhopeful88 commented 1 year ago

Same for most GUI clients using singbox as core like NekoRay and V2rayN. In some situations like startup after a former accidental quit, the previous network interface isn't removed automatically. Sometimes more restarts are needed do the trick.

Yes,I thinks so this,I had see on V2rayN github,the some one tell me add one remove function when open TUN,check it first,if exist ,remove it ,and open later,but the Devcon name was not consistent,I had not time to test it

Gasconyman commented 1 year ago

Has anyone found a solution for this problem? I am using v2rayN on windows 10, there is no config file in the Singbox directory to change the tunnel name.

Zhopeful88 commented 1 year ago

Has anyone found a solution for this problem? I am using v2rayN on windows 10, there is no config file in the Singbox directory to change the tunnel name.

Yes。I found it,and now ,I used the nekoray 3.16 was ok!3.17 use the latest sing-box was have some bug

nekohasekai commented 1 year ago

Since this is an issue caused by a third-party application, we will not discuss it any further.