Open littleskunk opened 8 years ago
I set the limit to 100G for a better logoutput. Both configs give me the following output:
2016-02-22 22:28:11,845 WARNING storjnode.storage.manager 62: Invalid storage limit for C:\Users\jensh_000\Storj: 107374182400 > available 85214018904. Using available 85214018904!
2016-02-22 22:28:11,848 WARNING storjnode.storage.manager 62: Invalid storage limit for C:\Users\jensh_000\Users\jensh_000\Storj: 85214018904 > available 1517244416. Using available 1517244416!
This is the code that gets the path. Why it doesn't use this util function I don't remember, there may be a reason, or it may just be an oversight on my part.
I moved many things from storjnode to storjlib, and in the future storjnode will need to be changed to use storjlib for that code (this will slim down storjnode a lot).
This is one of the functions I moved and changed here. I will backport the changes, but will need someone with a windows machine to confirm it works on windows as well.
def full_path(path):
"""Resolves, sym links, rel paths, variables, and tilds to abs paths."""
print path
prefix = "/" if path.startswith("/") else ""
print prefix
normalized = prefix + os.path.join(*re.findall(r"[^\\|^/]+", path))
print normalized
print os.path.abspath(os.path.expandvars(os.path.expanduser(normalized)))
return os.path.abspath(os.path.expandvars(os.path.expanduser(normalized)))
Output:
path = C:\Python27\Scripts\Storj
prefix =
normalized = C:Python27\Scripts\Storj
return = C:\Python27\Scripts\Python27\Scripts\Storj
So the full_path
function is correct on windows? If so it must have something to do with how the config is been given.
What were the exact arguments given to storjnode and the exact config used?
I see 2 problems. At the moment the config returns a wrong path. That is not the fault of full_path
. We should find and fix that bug first but it looks like the return value of full_path
as a second bug.
My config:
"storage": {
"C:/Storj": {
"use_folder_tree": false,
"limit": "100G"
}
},
Out of curiosity what does full_path return for "C:/Storj" on windows? Maybe there is some case I didn't see.
I am running python for windows (C:\Python27\Scripts): python storjnode --wallet=[...] --debug farm return = C:\Python27\Scripts\Python27\Scripts\Storj
That means it should be loading from the default config path and I assume the config you posted above is that.
@littleskunk what output do you get for storjnode --wallet=[...] --debug cfg_get_current
?
Server down at the moment. I will debug some more tomorrow starting with https://github.com/Storj/storjnode/blob/develop/storjnode/api.py#L67
cfg_get_current returns my config file %userprofile%.storj\cfg.json.
C:\Python27\Scripts>python storjnode --wallet xprv9s21ZrQH143K3m4QEqqF2hkQvTHczjeQbebVprErgQLF684MzDmbpMRDN4YdaTC9fxAFmw8sSKh6FqDXQYVZukmRgLhuYSbcTFca16Ut3EV cfg_get_current
2016-03-06 16:55:13,167 INFO storjnode.network.node 136: Started storjnode on port 30333 with address 1Gw99SmF9C1J8jLHHUQum4MMXeuB9kz78V
{
"cold_storage": [],
"version": 1,
"storage": {
"C:/Storj": {
"use_folder_tree": false,
"limit": "100G"
}
},
"network": {
"monitor": {
"crawler_interval": 3600,
"crawler_limit": 20,
"enable_responses": true,
"enable_crawler": true
},
"disable_data_transfer": false,
"bootstrap_nodes": [],
"bandwidth_limits": {
"sec": {
"downstream": 0,
"upstream": 0
},
"month": {
"downstream": "5G",
"upstream": "5G"
}
},
"refresh_neighbours_interval": 0,
"port": "random"
}
}
Found the bug. https://github.com/Storj/storjnode/blame/develop/storjnode/util.py#L118
Setup is called 2 times. The first call returns the wrong path that is the input for the second call.
2016-03-06 17:30:12,319 INFO storjnode.network.monitor 379: MONITOR POST CRAWL STATISTICS: {
"successfully_processed": 0,
"testing_bandwidth": false,
"waiting_for_bandwidth_test": 0,
"scanning_info_and_peers": 0
}
path = C:/Storj
prefix =
normalized = C:Storj
return = C:\Python27\Scripts\Storj
2016-03-06 17:30:12,385 WARNING storjnode.storage.manager 62: Invalid storage limit for C:\Python27\Scripts\Storj: 107374182400 > available 73353321997. Using available 73353321997!
path = C:\Python27\Scripts\Storj
prefix =
normalized = C:Python27\Scripts\Storj
return = C:\Python27\Scripts\Python27\Scripts\Storj
Output of that return statement os.path.expanduser(normalized) = C:Storj os.path.expandvars(os.path.expanduser(normalized)) = C:Storj os.path.abspath(os.path.expandvars(os.path.expanduser(normalized))) = C:\Python27\Scripts\Storj
My config:
I also tried:
Both configs don't work. Files are stored in %userprofile%/Storj in both cases.