Page 1 of 1

[BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 11:41
by JacobD88
Hi all, having a very strange problem with a BaNaNaS upload i made today
Specifically, the Rise of the Triad OST

BaNaNaS claims to download the set, but does not create the directory or indeed save the content
(Nightly 20200713, Windows 10 Professional x64)

Here's how to replicate (Numbers relate to screenshots also - See PNGs in BaNaNaS Error zip)

1) Locate the set on BaNaNaS

2) Select the set for download

3) Download the set (It will say it's downloaded)

4) The Set will not appear on the base music list under options

5) Returning to content download will reveal the set to be unchecked and not downloaded

6) You can confirm in the content download directory that the set was never copied there

Not sure how to resolve this
Is BaNaNaS having issues?

Many thanks

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 14:44
by Transportman
Where is your OpenTTD installed and where is your openttd.cfg located? It might be downloading to a location it cannot write to, making the download not actually processing (although I would expect some kind of error message if that happens).

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 15:02
by JacobD88
Install is located at

C:\Games\OpenTTD

It's an install i've upgraded with nightlies since OTTD 0.7 all those years ago and openttd.cfg has always been in the location of the main executable

All other content from bananas is downloading correctly it appears

SFC is disabled under WinLogon because i hate Windows 10 telling me what i can do with legacy locations

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 15:51
by jfs
The ROTT soundtrack also fails to download/install properly for me. It might be an issue with the new BaNaNaS somehow, I'll throw a debugger at it in a minute.

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 16:00
by Transportman
jfs wrote: 28 Jul 2020 15:51 The ROTT soundtrack also fails to download/install properly for me. It might be an issue with the new BaNaNaS somehow, I'll throw a debugger at it in a minute.
I tried with the debug logging enabled, it shows that it actually downloaded it, as this is what I get in the logging:

Code: Select all

dbg: [misc] Found tar 'C:\Users\****\Documents\OpenTTD\content_download\baseset\524f5454-Rise_of_the_Triad_OST_NST-1.0.tar' with 30 new files
Going to that location, the file is not there.

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 16:15
by jfs
Yes I found the problem.
It fails on this bit of code:

Code: Select all

bool ExtractTar(const char *tar_filename, Subdirectory subdir)
{
	TarList::iterator it = _tar_list[subdir].find(tar_filename);
	/* We don't know the file. */
	if (it == _tar_list[subdir].end()) return false;

	const char *dirname = (*it).second.dirname;

	/* The file doesn't have a sub directory! */
	if (dirname == nullptr) return false;
All the files in your TAR file are in the root of the archive. They must be in a subdirectory inside the archive for it to be accepted. As it is, the file gets downloaded, unpacked, and then rejected before extraction, and then deleted.

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 17:56
by JacobD88
That's a bananas issue then
As i uploaded this ZIP
As attached to BaNaNaS

It must have stripped the directory...

This is possibly because the ZIP and the directory within the ZIP have the same name...

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 20:09
by jfs
Right.

I made a PR to OpenTTD itself to make it log a warning when TAR extraction fails for this reason: https://github.com/OpenTTD/OpenTTD/pull/8283

And a bug report for new BaNaNaS stripping the directories from the archive: https://github.com/OpenTTD/bananas-server/issues/23

Re: [BaNaNaS] Downloads are not actually saved

Posted: 28 Jul 2020 20:14
by JacobD88
Brilliant, thanks JFS
Will leave the file alone on BaNaNaS until issue is resolved
Then i will update accordingly if required by any fix :)