Why is cv.glmnet giving a lambda.min that is clearly not the lambda for minimum error? I have X possible predictors for response Y.  In my case X >> Y.
I have noticed in my runs of cv.glmnet (leave-on-out and all other params default) that if I try to predict using lambda.min that it simply returns the mean value of Y.  If I run the prediction with choices of lambda < lambda.min, it gives actual predictions - which have a lower error than using the mean value of Y.
I'm not sure what's going on here.  It's as if the code is defaulting to a dummy predictor (the mean response) for some reason.  It appears that this behavior is a function of the size of X.  
Here's a simple example:
x=replicate(100,rnorm(10))

y=replicate(1,rnorm(10))

cvfit=cv.glmnet(x,y,nfolds=10)

ypred1=predict(cvfit,newx=x,s="lambda.min")

(in a case I just ran, this gives a cvfit$lambda.min = 0.8453387 and all entries in 
ypred1 are the mean value of y.  So, let's choose a different lambda)
ypred2=predict(cvfit,newx=x,s=0.1)

mse1=mean((ypred1-y)^2) = 1.20

mse2=mean((ypred2-y)^2) = 0.03

I understand that "newx=x" doesn't make sense for any real work, but I don't understand why it returns the predictions it does.
 A: Here, glmnet is working as intended! In your example, there is no relationship between $x$ and $y$ (both were independently generated). So the ``correct'' thing to do is to just always predict $\hat{y} = \bar{y}.$ Any method that isn't doing that is overfitting the test set. 
A: This is simply a case of how glmnet generates a default sequence of lambdas.  It calculates the maximum lambda in its grid search based on a computation from your data, it is essentially the minimal lambda that sets all the coefficients in your model equal to zero.
The details are in this paper, but the rub is that:
$$ N \alpha \lambda_{max} = \max_l \| \langle x_l, y \rangle \| $$
Since the correct answer in your case is to zero out all (non-intercept) coefficients, I would guess it quite likely that cv.glment is returning this $\lambda_{max}$ as optimal.
A: 
lambda.1se == lambda.min
"All entries in ypred1 are the mean value of y"

Both of these tell you that your coefficients got zeroed out. (You should always inspect the coefficients with coef(cvfit, s='lambda.1se')) Either lambda was too small, or your x variables weren't normalized. Or they simply aren't predictive of y.
Never rely on the "default" lambda sequence, always supply your own one:
cv.glmnet(..., lambda=10^(seq(m,-n,0.2)))
which uses a lambda geometrically from 10^m ... 10^(-n).
You choose m, -n to be wide enough to cover the range that includes all possible optimal values of lambda.
So rerun with that, then pick the right lambda./ Also, show us your deviance plot: plot.cv.glmnet(cvfit, sign.lambda=-1) There's supposed to be a knee in it. Yours apparently doesn't.
If you double-checked all the above, then your x-variables simply aren't predictive of y. (unless you made a gross error and you scrambled x,y)
