Why does my board say it can't reach the board file?
Nearly always because the server holding the file does not allow other websites to read it. The fix is one response header on the file: Access-Control-Allow-Origin.
What each message means
| The board says | Usual cause | Fix |
|---|---|---|
| Can't reach the board file | The file's server does not send the cross-site header, so the browser refuses to hand the file over. Less often: a typing mistake in the address, a server that is down, or a file that took more than ten seconds to arrive. | Add Access-Control-Allow-Origin: * to the file's response. The settings for each host are in where to host a board file. |
| The board file answered 404 | The address is wrong, or the file was never uploaded. | Open the file's address in a browser tab by itself. Fix the address until the JSON appears. |
| The board file answered 403 | The file exists but is not public. | Allow reading without signing in, in the host's permissions. |
| The board file must use https | The address after src= starts with http://. | Serve the file over https. |
| The board file is not valid JSON | A trailing comma, a missing quote mark, or a web page being served where the file should be. | Paste the file into the editor, which points to the line. |
| The board file has errors | The JSON is fine but it is not a valid board: a state that does not exist, a missing label, an arrow to a node that is not there. | The board lists the problems. The editor lists them too, by field. |
| That address does not work | What follows src= is not a web address. | Use the file's full address, starting with https://. |
Some hosts leave the cross-site header off their error pages. On those, a missing or private file shows as "Can't reach the board file" rather than as a number, so check the address and the permissions as well as the header.
You do not have to reload the page after fixing any of these. The board tries again every 15 seconds and appears as soon as a read succeeds.
Checking the cross-site header
From a terminal:
curl -sI -H "Origin: https://fluxglow.com" https://example.com/board.jsonA file the board can read answers with a line like this among the others:
access-control-allow-origin: *If that line is missing, the header is not set. In the browser, the same problem shows in the developer console as a message that the request was "blocked by CORS policy".
Why opening the file in a tab is not enough
A file can open perfectly in its own tab and still be unreadable by the board. A browser will show you any address you type. It only lets one website read from another when the second one agrees, and the header is how a server agrees. The rule comes from the browser, so no setting on FluxGlow can waive it.
Addresses that contain ? or &
If the file's own address has a ? or an & in it, as signed bucket addresses do, the board page cannot tell where your address ends and its own options begin. Encode the address first. In a browser's console:
"https://fluxglow.com/board?src=" + encodeURIComponent("https://example.com/board.json?v=2&sig=abc")It worked, and now it is grey
That is a different situation: the board loaded once and has since lost touch with its file. See why a board goes grey.
Related questions
-
Where can I host a board file?
Anywhere that serves the file over https, lets other websites read it, and does not cache it for long. A storage bucket, a public GitHub repository or a web server you already run will all do.
-
Why has my board gone grey?
A grey board has stopped trusting what it is showing. Either the file says it should have been rewritten by now and was not, or the last attempts to read it failed. A line at the bottom of the board says which.
-
Can FluxGlow see what is on my board?
No. Your browser fetches the board file straight from wherever you host it and draws it on the spot. The contents of the file never pass through FluxGlow.