[ERROR] Cache directory naming error, file already exists, mkdir 'C:\Users\abc\.anyproxy\cache\cache_r636877'

bis0qfac  于 5个月前  发布在  其他
关注(0)|答案(7)|浏览(69)

Anyproxy crashed at the creating process after several times of started and closed in js code.
Infact, I haven't found a way to change a anyproxy server's rule after initializing the server. so I have to create a new one every time when the rule changed. And after a few times, one server crashed with the error shown below:

  • Windows 10
  • nodejs 8.3
  • anyproxy 4.0.10
ErrorMessage:

the bug happened at:

the directory which the bug message referred:

config file:

I suppose it is a directory naming problem, which is seldom happened. But it happened! So please make some effort to improve it's usability!

uemypmqf

uemypmqf1#

Hi @Sherler
Sorry about the cache name issue, it's a random code so there is really a chance to be conflicted, we should check the existance before creating it.

BTW, the older cache folder should be cleard after each stop, so can you share the process about how you closing AnyProxy, did you see the console clearing cache file... when restart it?

j2qf4p5b

j2qf4p5b2#

as you can see in my cache dir, none of my proxy cache files is deleted.
here is my way of closing proxy:

let _proxyServer = new AnyProxy.ProxyServer(_proxyConfig);
    return {
        proxyStartCallback:(onStartCallback)=>{
            _proxyServer.on('ready', ()=>{
                onStartCallback()
                this.proxyServer = _proxyServer
            });
            _proxyServer.on('error', (e) => { 
                console.error(e) 
            });
            _proxyServer.start()
        },
        proxyEndCallback:()=>{
            _proxyServer.close();
            this.proxyServer = null;
        }
    }
lo8azlld

lo8azlld3#

I see it :
[AnyProxy Log][2018-08-06 15:09:04]: clearing cache file...
and the cache file is empty:

so, you didn't clear the cache directory...

pxiryf3j

pxiryf3j4#

oh, sorry, the cache directory is cleared too. But there were times, my project crashed for some other reason, and the method proxyServer.close() can't be called at that time. So, there is no problem in the closing process.

jckbn6z7

jckbn6z75#

@Sherler
I see, so there are problems when AnyProxy crashed for some reason, we are working to solve this, maybe will clear the full cache folder instead just the cache_xxxx ones.

uttx8gqw

uttx8gqw6#

@codingfishman yeah, thank you very much, and waiting for the new updates!

相关问题