This isn't quite an answer, but the formatting would be horrible in a comment. (Will delete or edit later if the question gets resolved.)
I can't reproduce, so far. Here is a reproducible example:
set.seed(101)
d <- data.frame(covariate=runif(500),response=rnorm(500),
factorA=factor(sample(1:5,size=500,replace=TRUE)),
factorB=factor(sample(1:5,size=500,replace=TRUE)))
library("nlme")
control <- lmeControl(maxIter=100,opt = c("optim"))
m1 <- lme(response ~ 0+factorA+covariate,random=~1|factorB,
weights=varIdent(form= ~1|factorA),control=control,
data=d)
Since this works, it's hard to go farther.
It would be best if you can provide a reproducible example. Short of that, you can debug/help debug by setting options(error=recover)
or debug(nlme:::logLik.reStruct)
. Once you get into the browser, you can try commands like
ls()
str(object)
str(conLin)
dput(object)
dput(conLin)
and provide the results as appropriate.