Open Bug 1466603 Opened Last year Updated Last year

vagrant dev environment flakiness awareness: "/vagrant/scripts/js-analyze.js:1221:1 Error: can't read /vagrant/sax/sax.js: short read"


(Webtools :: Searchfox, defect)

Not set


(Not tracked)


(Reporter: asuth, Unassigned, NeedInfo)


I've started experiencing errors like the following on an pass on a vagrant 2.0.2+dfsg-2ubuntu8 VM on Ubuntu 18.04 LTS that's been up for a while:

/vagrant/scripts/js-analyze.js:1221:1 Error: can't read /vagrant/sax/sax.js: short read
Which is at the line `run(mozSearchRoot + "/sax/sax.js");`

I believe this is the logic (or at least replicated idiom) in the JS shell runtime that's sad which is basically fseek(SEEK_END), ftell(), fseek(0), fread(file length):

The man page for fread(3) says:
If an error occurs, or the end of the file is reached, the return value is a short item count (or zero).

fread() does not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred.

So it appears the issue is vagrant's /vagrant mount-point being flaky and returning intermittent errors that break the higher level fread semantics.  I don't think it makes sense to try and fix this in the JS shell or otherwise; spurious FS errors are a problem not worth trying to paper over.

I'm just logging this bug for search visibility in case others run into this in the future and am NI-ing myself now to resolve WFM in the near future once I upgrade to the current official Vagrant 2.1.1 build and run for a few days.
Flags: needinfo?(bugmail)
At first glance, it looks like my recent upgrade to Ubuntu 18.04 probably made the VirtualBox "Guest Additions" version mismatch a problem.

With the problem happening reliably, I was at:
    default: Guest Additions Version: 5.1.14
    default: VirtualBox Version: 5.2

Since upgrading inside the VM via "apt install virtualbox-guest-dkms" the JS analyze issues are past and my mismatch is now as follows:
    default: Guest Additions Version: 5.1.34
    default: VirtualBox Version: 5.2

On Ubuntu 18.04, my VirtualBox version is identified as 5.2.10-dfsg-6.
You need to log in before you can comment on or make changes to this bug.