adulau / Forban

Forban is a p2p application for link-local and local area networks. Forban works independently from the Internet and uses only the local area capabilities to announce, discover, search or share files. Forban relies on HTTP and it is "opportunistic".
http://www.foo.be/forban/
134 stars 24 forks source link

Index isn't rebuild #14

Closed MaStr closed 12 years ago

MaStr commented 12 years ago

With usage of cleanloot the index-file is not existent: Message on Web-UI:

Missing index from this loot [browse]

forban_announce DEBUG-output:

1970-01-01 00:21:30,351 - forban_announce - DEBUG - Index rebuilt 1970-01-01 00:21:30,360 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:22:30,426 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:23:30,506 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:24:30,586 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:25:30,787 - forban_announce - DEBUG - Index rebuilt 1970-01-01 00:25:30,795 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:26:30,866 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:27:30,936 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119 1970-01-01 00:28:31,006 - forban_announce - DEBUG - forban;name;piratebox.lan;uuid;6e6dc51b-6255-48b6-a215-b8a84ac1fd2f;hmac;75ba4f7f6643712cdc6b5db902ae377ed22b7119

Clicking on "browse" returns an internal Server Error:

[01/Jan/1970:00:33:42] HTTP Traceback (most recent call last): File "/opt/forban/lib/ext/cherrypy/_cprequest.py", line 656, in respond response.body = self.handler() File "/opt/forban/lib/ext/cherrypy/lib/encoding.py", line 188, in call self.body = self.oldhandler(_args, _kwargs) File "/opt/forban/lib/ext/cherrypy/_cpdispatch.py", line 34, in call return self.callable(_self.args, _self.kwargs) File "/opt/forban/bin/forban_share.py", line 283, in l tempindex = mindex.search("^((?!forban).)*$", uuid) File "/opt/forban/lib/index.py", line 119, in search f = open(location, "r") IOError: [Errno 2] No such file or directory: '/opt/forban/var/loot/6e6dc51b-6255-48b6-a215-b8a84ac1fd2f/cache/forban/index'

[01/Jan/1970:00:33:42] HTTP Request Headers: REFERER: http://192.168.56.10:12555/ HOST: 192.168.56.10:12555 CONNECTION: keep-alive Remote-Addr: ::ffff:192.168.56.5 ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3 USER-AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.152 Safari/535.19 ACCEPT-LANGUAGE: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 ACCEPT-ENCODING: gzip,deflate,sdch

adulau commented 12 years ago

It makes sense. If forban_discover is not able to fetch via HTTP the index (including itself), it won't be cached into the loot directory.

It seems that everything (Issue #13) is linked together. Could it be that Forban is starting before the IPv4 address is ready? (like the mesh not up?)

MaStr commented 12 years ago

No, no mesh feature currently active. I discovered this while testing the basic functionality of forban while startup. Later on, I restarted forban without any effect.

adulau commented 12 years ago

Ok, we will start by testing the whole process:

Can you download the index for the local Forban?

http://127.0.0.1:12555/s/?g=forban/index

If yes, can you download it from the source IP where the announce is from:

http://IPSOURCE:12555/s/?g=forban/index

If this works, it seems that the forban_discover doing the same process is not able to store the cache file. Maybe the permission to recreate the directory per loot?

Let me know.

MaStr commented 12 years ago

Yes wget http://127.0.0.1:12555/s/?g=forban/index works fine.

   wget http://192.168.56.10:12555/s/?g=forban/index

works fine, too

Grr, openwrt-wget isn't able to download from ipv6 addresses and my homelan isn't setup correctly