Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'errno 28' #76

Open
wan-may opened this issue Jan 21, 2023 · 4 comments
Open

'errno 28' #76

wan-may opened this issue Jan 21, 2023 · 4 comments

Comments

@wan-may
Copy link

wan-may commented Jan 21, 2023

Hello,

I used LOVE for the first time recently. The game works on Windows 10. I couldn't get it working for the web, and I don't know why.

I used love.js.cmd to build. It throws no errors at build time. I allocated different amounts of memory, tried the compatibility flag, switched all my audio between "static" and "shared" and back, made sure the fragment shader worked in OpenGLES. Nothing seems to work. It just throws 'errno 28' in the middle of some giant obfuscated line of javascript.

I tested the web version by uploading it to itch.io. My browser is Waterfox G5.1.2 (64 bits). I'm using LOVE version 11.4.

I took the build down because it wasn't working, but the source code (as a .love file) can be downloaded here: https://wan-may.itch.io/your-own-drum. I'm sorry I don't have a smaller reproducible example, I'm very unfamiliar with LOVE and the web, so I have no idea where to start narrowing down where the problem might be. Can someone please take a look?

@lenaschimmel
Copy link

lenaschimmel commented Jan 28, 2023

I got the same error, no matter if I tried it with our full game, or with the minimal love example which only has a main.lua with this content:

function love.draw()
    love.graphics.print("Hello World", 400, 300)
end

My setup:

  • Mac OS 13.1
  • M1 Pro Processor (ARM-based)
  • love.js version 11.4.1
  • node v19.1.0
  • Served from localhost via Caddy with https and the two needed headers for SharedArrayBuffer
  • Tested on these browsers on the same computer:
    • Firefox 109.0
    • Chrome Version 109.0.5414.119 (arm64)
    • Version 16.2 (18614.3.7.1.5)

The actual error message looks a bit different on my two browsers, especially the stack trace.

Firefox:

Object {
node: undefined, 
setErrno: setErrno(errno), 
errno: 28, 
message: "FS error", 
stack: "ensureErrnoError@https://localhost/love.js:9:92373\nstaticInit@https://localhost/love.js:9:92593\nLove@https://localhost/love.js:9:343062\napplicationLoad@https://localhost/index.html:102:13\nonload@https://localhost/index.html:1:16\n" 
}

Chrome:

ErrnoError {node: undefined, errno: 28, message: 'FS error', setErrno: ƒ}
  | mknod | @ | love.js:9
  | create | @ | love.js:9
  | createDataFile | @ | love.js:9
  | finish | @ | game.js:118
  | onload | @ | game.js:112
  | processPackageData | @ | game.js:236
  | putMetadataRequest.onsuccess | @ | game.js:209
  | IndexedDB (async) |   |  
  | putPackageRequest.onsuccess | @ | game.js:207
  | IndexedDB (async) |   |  
  | cacheRemotePackage | @ | game.js:203
  | (anonymous) | @ | game.js:263
  | xhr.onload | @ | game.js:76
  | load (async) |   |  
  | fetchRemotePackage | @ | game.js:73
  | (anonymous) | @ | game.js:261
  | getRequest.onsuccess | @ | game.js:175
  | IndexedDB (async) |   |  
  | checkCachedPackage | @ | game.js:171
  | (anonymous) | @ | game.js:253
  | openRequest.onsuccess | @ | game.js:159
  | IndexedDB (async) |   |  
  | openDatabase | @ | game.js:140
  | runWithFS | @ | game.js:251
  | callRuntimeCallbacks | @ | love.js:9
  | preRun | @ | love.js:9
  | run | @ | love.js:9
  | runCaller | @ | love.js:9
  | removeRunDependency | @ | love.js:9
  | (anonymous) | @ | love.js:9
  | worker.onmessage | @ | love.js:9

Safari output was very similar, but had problems copying it, so it's not included.

@DMClVG
Copy link

DMClVG commented Sep 28, 2023

You have to refrain from using directories such as "." or ".." for the game directory when compiling using love.js. I moved my game from the current directory to a subdirectory and (in my case) it works well now

@ChicknTurtle
Copy link

You have to refrain from using directories such as "." or ".." for the game directory when compiling using love.js. I moved my game from the current directory to a subdirectory and (in my case) it works well now

This did not solve my issue. I am getting errno 20, not 28, but very similar issue.
Before: love.js ./ packaged-game -t game -c -m 100000000
After: love.js src packaged-game -t game -c -m 100000000

love.js:9 Uncaught ErrnoError {node: undefined, errno: 20, message: 'FS error', stack: '<generic error, no stack>', setErrno: ƒ}

@ChicknTurtle
Copy link

ChicknTurtle commented May 14, 2024

This is where the error is coming from:

            mknod: function(path, mode, dev) {
                var lookup = FS.lookupPath(path, {
                    parent: true
                });
                var parent = lookup.node;
                var name = PATH.basename(path);
                if (!name || name === "." || name === "..") {
                    throw new FS.ErrnoError(28)
                }
                var errCode = FS.mayCreate(parent, name);
                if (errCode) {
                    throw new FS.ErrnoError(errCode)
                }
                if (!parent.node_ops.mknod) {
                    throw new FS.ErrnoError(63)
                }
                return parent.node_ops.mknod(parent, name, mode, dev)
            },

When commenting out the line that throws the error, I get a new error:

game.js:292 Uncaught TypeError: Cannot read properties of null (reading 'onload')
    at processPackageData (game.js:292:61)
    at putMetadataRequest.onsuccess (game.js:265:11)
function processPackageData(arrayBuffer) {
                Module.finishedDataFileDownloads++;
                assert(arrayBuffer, 'Loading data file failed.');
                assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
                var byteArray = new Uint8Array(arrayBuffer);
                var curr;

                // copy the entire loaded file into a spot in the heap. Files will refer to slices in that. They cannot be freed though
                // (we may be allocating before malloc is ready, during startup).
                if (Module['SPLIT_MEMORY'])
                    Module.printErr('warning: you should run the file packager with --no-heap-copy when SPLIT_MEMORY is used, otherwise copying into the heap may fail due to the splitting');
                var ptr = Module['getMemory'](byteArray.length);
                Module['HEAPU8'].set(byteArray, ptr);
                DataRequest.prototype.byteArray = Module['HEAPU8'].subarray(ptr, ptr + byteArray.length);

                var files = metadata.files;
                for (i = 0; i < files.length; ++i) {
                    DataRequest.prototype.requests[files[i].filename].onload(); // << error on this line
                }
                Module['removeRunDependency']('datafile_game.data');

            }
            ;Module['addRunDependency']('datafile_game.data');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants