AudioMasher icon indicating copy to clipboard operation
AudioMasher copied to clipboard

Building locally fails

Open 6r1d opened this issue 4 years ago • 9 comments
trafficstars

Hello. It seems the hosted version is down. Is there a plan to restore it, or is it stopped? I am trying to build AudioMasher locally and having this issue with go build and go get.

package github.com/asdine/storm/v3: cannot find package "github.com/asdine/storm/v3" in any of:
	/usr/lib/go-1.10/src/github.com/asdine/storm/v3 (from $GOROOT)
	/home/grid/go/src/github.com/asdine/storm/v3 (from $GOPATH)

6r1d avatar Nov 26 '20 06:11 6r1d

Thanks for pointing this out, I was playing with other stuff on the same server and apparently it just ran out of memory. It's back up now, maybe I should use another server for my experiments 😄. As for building, I just tried with a fresh Go install (the latest golang:alpine docker image) and it seems to build and run just fine. Random guess, is your version of Go up to date? AudioMasher uses Go modules so it requires at least Go 1.11.

pac-dev avatar Nov 26 '20 15:11 pac-dev

Thanks, it's good to see the Sporth sources back! Also, this Audiomasher version crashes on Chrome / Chromium 86.0.4240.198 and Firefox 83.0, but it worked perfectly previously. I don't know much about WASM right now to assume why, but maybe this log will be useful to see.

Access to fetch at 'https://static.audiomasher.org/ugen_reference.html' from origin 'https://audiomasher.org' has been
blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
If an opaque response serves your needs, set the request's mode
to 'no-cors' to fetch the resource with CORS disabled.
masher.js:26 GET https://static.audiomasher.org/ugen_reference.html net::ERR_FAILED
(anonymous) @ masher.js:26
(index):1 Uncaught (in promise) TypeError: Failed to fetch
Promise.then (async)
(anonymous) @ masher.js:30
(index):1 Access to fetch at 'https://static.audiomasher.org/sporthem.wasm' from origin 'https://audiomasher.org'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
If an opaque response serves your needs, set the request's mode to 'no-cors'
to fetch the resource with CORS disabled.
sporthem.js:1 GET https://static.audiomasher.org/sporthem.wasm net::ERR_FAILED
doNativeWasm @ sporthem.js:1
(anonymous) @ sporthem.js:1
(anonymous) @ sporthem.js:1
(index):1 Access to fetch at 'https://static.audiomasher.org/sporthem.wasm' from origin 'https://audiomasher.org'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource
with CORS disabled.
sporthem.js:1 GET https://static.audiomasher.org/sporthem.wasm net::ERR_FAILED
getBinaryPromise @ sporthem.js:1
instantiateArrayBuffer @ sporthem.js:1
(anonymous) @ sporthem.js:1
Promise.then (async)
doNativeWasm @ sporthem.js:1
(anonymous) @ sporthem.js:1
(anonymous) @ sporthem.js:1
(index):1 Uncaught (in promise) abort("abort(\"both async and sync fetching of the wasm failed\").
Build with -s ASSERTIONS=1 for more info."). Build with -s ASSERTIONS=1 for more info.
Promise.then (async)
instantiateArrayBuffer @ sporthem.js:1
(anonymous) @ sporthem.js:1
Promise.then (async)
doNativeWasm @ sporthem.js:1
(anonymous) @ sporthem.js:1
(anonymous) @ sporthem.js:1

AudioMasher uses Go modules so it requires at least Go 1.11.

Oops, my Go version was outdated indeed. I've updated it using Nix now, it has fresh packages. Thanks again!

6r1d avatar Nov 27 '20 12:11 6r1d

Is this still happening? I can't seem to reproduce this problem. Your log correctly says that says that some files served by static.audiomasher.org require CORS headers, but I've set these headers on the static host a long time ago, and they are still there as far as I can tell.

pac-dev avatar Nov 28 '20 03:11 pac-dev

I can't seem to reproduce this problem.

Interesting!

To be clear, that's what I see locally. A test on a VM is inconclusive: no sound is playing on Audiomasher, usual errors don't show, but there's sound in VM / Browser, when I open Bandcamp.

but I've set these headers on the static host a long time ago, and they are still there as far as I can tell

If that's the case, I can only think about some weird config messing up with headers on my ISP's side, then.

6r1d avatar Nov 28 '20 08:11 6r1d

Regarding your test in a VM, this seems to be a problem with an old version of firefox that was fixed in firefox 55: https://bugzilla.mozilla.org/show_bug.cgi?id=1361475

I'm still stumped on the CORS thing, though. If you're on Linux or WSL, here is a command that should tell us if the correct headers are there: curl --silent --header "Origin: http://audiomasher.org" --dump-header - https://static.audiomasher.org/ugen_reference.html -o /dev/null

I've always found CORS to be a minefield anyways, so maybe I should just serve those files from the Go server instead of the static host so I don't have to deal with CORS. It would be a bit less efficient, but I'm not dealing with large traffic anyways, and I think it's more important for this to work everywhere.

pac-dev avatar Nov 28 '20 20:11 pac-dev

There's some very interesting development. Without any manual updates (i.e. using open dev panel, hard reloads and cleaning cache as before), I now see AudioMasher working!

I doubt it's useful now, but just for history, there's a result for the command. I wonder if Cloudfront could've influenced the update somethow?

curl --silent --header "Origin: http://audiomasher.org" --dump-header - https://static.audiomasher.org/ugen_reference.html -o /dev/null
HTTP/2 200 
content-type: text/html
content-length: 17006
date: Sun, 29 Nov 2020 09:42:55 GMT
access-control-allow-origin: *
access-control-allow-methods: GET
access-control-max-age: 3000
last-modified: Sun, 01 Jul 2018 16:47:59 GMT
etag: "74d3d35556a0c03e14f68cfb772b3fcf"
accept-ranges: bytes
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 209eb3c6f1b9e1174696d24afc301619.cloudfront.net (CloudFront)
x-amz-cf-pop: HEL50-C2
x-amz-cf-id: CqWfNNdOBNFcqf7p64LnrTp72d_fxJos4dbtlMCEwNUB-IZ4OZP68g==

And this is the result in Chromium:

Status Code: 304 
Remote Address: 13.225.73.49:443
Referrer Policy: no-referrer-when-downgrade
accept-ranges: bytes
access-control-allow-methods: GET
access-control-allow-origin: *
access-control-max-age: 3000
age: 4
content-length: 17006
content-type: text/html
date: Sun, 29 Nov 2020 09:44:42 GMT
etag: "74d3d35556a0c03e14f68cfb772b3fcf"
last-modified: Sun, 01 Jul 2018 16:47:59 GMT
server: AmazonS3
status: 304
via: 1.1 2fcedcc055e24d7ac99fbc19ed8fc8ec.cloudfront.net (CloudFront)
x-amz-cf-id: g-8-BncuEwFFuJCamGqxCYaQfNw0Q1k9J07uzvfQtujmHRUqn0JGbA==
x-amz-cf-pop: FRA2-C2
x-cache: Hit from cloudfront
X-DNS-Prefetch-Control: off

Local build with Nix worked, too.

In any case, thanks a lot for your help and for AudioMasher, this is an amazing project! :-)

6r1d avatar Nov 29 '20 09:11 6r1d

P.S.: I can't open AudioMasher for some reason, it seems to be down currently for everyone I've asked. I guess it's best to make a backup of the modules when it will be online again. :-)

6r1d avatar Dec 03 '20 22:12 6r1d

Odd, the server stopped yesterday and I'm not sure why (seems to be an issue with the machine rather than AudioMasher itself). It's back online now, I'll investigate the logs and consider changing servers. Thanks for pointing it out again. The database is already backed up, maybe I should make it available in some other form?

pac-dev avatar Dec 03 '20 22:12 pac-dev

It's back online now, I'll investigate the logs and consider changing servers

Thank you!

The database is already backed up, maybe I should make it available in some other form?

I made a tiny crawler to define the "archiving format", do you think it is a good approach? There it is, I have used Python and Selenium to do the archiving. (Because I had the file tab open, not because it's the best approach, the native Go version will be more useful.)

Patches were tested, I can hear the sounds I'm used to.

If I can copy the license you'll pick for the patches from some URL and you'll fork the repository, that'll be great. (I believe people shouldn't search for the archive on a separate account.)

6r1d avatar Dec 06 '20 10:12 6r1d