Your vertex positions sizes don't match

Code :
glVertexAttribPointer(vertexId, 2, GL_FLOAT, GL_FALSE, sizeof(vertices), 0)


size 2

Code :
attribute vec4 vertex;


size 4