Could you post some more details? When you originally created the model object (idss(A,B,C,D)), what were the sizes of the matrices? If you are fitting a model to a single signal, B must be nx-by-0, C must be 1-by-nx, and D must be 1-by-0 matrix. You probably would need a K matrix of size nx-by-1 defining the initial value of disturbance matrix K (could be NaNs if you do not have an initial guess), so you actually create idss(A,B,C,D,K). Note that when you fit a signal, it is treated as a time series (a process driven by white noise):
dx/dt = A x + Ke
y = Cx + e
This is conceptually similar to the single-input, single-output model, if you think of e(t) as input u (t). Then K (times square root of noise variance) represents the "B" matrix and D = 1 of the standard state-space form. In fact, you can use "noise2meas" command to convert the time series model into a more familiar input-output model.
Direct estimation: If you want to fit a state-space model directly (that is, no intermediate creation of a model), you can use the syntax ssest(y,2) just the way you originally tried. For more control over data properties, you should actually do:
data iddata(y, , Ts, 'tstart', 0);
model = ssest(data, 2);
iomodel = noise2meas(model);
If that did not work for you, you must post some reproduction steps so that I can investigate it more thoroughly.