It means the location you are using came from another program. Programs do not share locations, even if they are using the same shaders. Example:
// make a vertex and a fragment shader
var vs = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vs, vSource);
gl.compileShader(vs);
var fs = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fs, fSource);
gl.compileShader(fs);
// now make 2 identical programs from those shaders
var p1 = gl.createProgram();
gl.attachShader(p1, vs);
gl.attachShader(p1, fs);
gl.linkProgram(p1);
var p2 = gl.createProgram();
gl.attachShader(p2, vs);
gl.attachShader(p2, fs);
gl.linkProgram(p2);
// Get a uniform location from program1
var location1 = gl.getUniformLocation(p1, "someUniform");
// Try to use that location on program2
gl.useProgram(p2);
gl.uniform4fv(location1, [1, 2, 3, 4]); // ERROR!!!
Trying to use a location from program 1 on program 2 is not allowed. You must get locations for program 2 to set uniforms on program 2.