sdk icon indicating copy to clipboard operation
sdk copied to clipboard

002177 -> 002179: `dotnet restore`: "the structure of init data has changed"

Open colemickens opened this issue 10 years ago • 16 comments

dotnet-dev-1.0.0-beta-002177 works

upgraded to dotnet-dev-1.0.0-beta-002179. cleared nuget cache. This is all in Docker so it's a "clean" install of 002179.

$ dotnet restore
The structure of init data has changed, do not know how to interpret it
$ COREHOST_TRACE=1 dotnet restore
Tracing enabled
--- Invoked host main = {
dotnet
restore
}
Resolved fxr [/usr/share/dotnet/libhostfxr.so]...
Tracing enabled
Own DLL path=[/usr/share/dotnet/dotnet.dll]
Checking if CoreCLR path exists=[/usr/share/dotnet/libcoreclr.so]
Host operating in Muxer mode
--- Executing in muxer mode...
--- Resolving dotnet from working dir
Probing path [/opt/dotkube/Dotkube.Api/global.json] for global.json
Probing path [/opt/dotkube/global.json] for global.json
Found global.json [/opt/dotkube/global.json]
--- Resolving CLI version from global json [/opt/dotkube/global.json]
CLI '/sdk/version' field not present/null in [/opt/dotkube/global.json]
--- Resolving SDK version from SDK dir [/usr/share/dotnet/sdk]
Considering version... [..]
Considering version... [1.0.0-beta-002179]
Considering version... [.]
No production version found, so using latest prerelease
Checking if resolved SDK dir [/usr/share/dotnet/sdk/1.0.0-beta-002179] exists
Resolved SDK dir is [/usr/share/dotnet/sdk/1.0.0-beta-002179]
Found CLI SDK in: /usr/share/dotnet/sdk/1.0.0-beta-002179
Using dotnet SDK dll=[/usr/share/dotnet/sdk/1.0.0-beta-002179/dotnet.dll]
Runtime config [/usr/share/dotnet/sdk/1.0.0-beta-002179/dotnet.runtimeconfig.json] is valid=[1]
Executing dotnet.dll as a portable app as per config file [/usr/share/dotnet/sdk/1.0.0-beta-002179/dotnet.runtimeconfig.json]
--- Resolving FX directory from muxer dir [/usr/share/dotnet]
Did not roll forward because rollfwd=1 and [1.0.0-rc2-23931] is prerelease=1
Chose FX version [/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-23931]
The structure of init data has changed, do not know how to interpret it

colemickens avatar Apr 01 '16 16:04 colemickens

Now I'm getting this on 002177 on a different machine, which makes me suspicious of apt, as the only thing that differs between these two machines is that one has a cached docker layer from when I initially switched to 002177.

colemickens avatar Apr 01 '16 23:04 colemickens

Well, dpkg -l | grep dotnet seems to indicate that they both have the same packages installed. Very strange. The dockerfiles are identical. Both workspaces have no modifications and are on the same git revision. Any suggestions would be great.

colemickens avatar Apr 01 '16 23:04 colemickens

I don't really understand why it was working on one machine, but manually force upgrading (apt thinks it's a downgrade) dotnet-host on my new machine allows restore to occur, so when dotnet/cli#2195 is fixed I'll close this out as well.

colemickens avatar Apr 02 '16 00:04 colemickens

@colemickens hit this as well today

The host package version issue is the root cause.

brthor avatar Apr 02 '16 00:04 brthor

It's a case of an older root host communicating with a newer host policy library and blowing up.

brthor avatar Apr 02 '16 00:04 brthor

Does the sharedframework need to depend on a specific version of dotnet-host? Otherwise if I install an older dotnet-beta build and then it pulls the latest dotnet-host, which could be too new?

colemickens avatar Apr 02 '16 05:04 colemickens

I hit this today with 2284 in win10-x64. I cleared the shared framework, but get the error.

natemcmaster avatar Apr 07 '16 18:04 natemcmaster

I believe part of the issue is that the isntaller scripts (scripts/obtain) don't correctly clear old versions. Completely deleting the folder where dotnet is installed (e.g. ensure I cleared the muxer, shared framework, and sdk) fixed the problem for me.

natemcmaster avatar Apr 07 '16 18:04 natemcmaster

Seems like one can work around this for now with:

sudo cp /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-23931/libhostfxr.so /usr/share/dotnet/

gregg-miskelly avatar Apr 08 '16 00:04 gregg-miskelly

The problem is that the apt repo needs to be cleaned up so that older versions of dotnet-host aren't selected instead of newer versions. Also, if dotnet-host doesn't have some sort of stable interface, it seems like it would need to be side-by-side installable as well... no?

I'm working around this by specifying the exact version of dotnet-host to install via apt. You can see my Dockerfile here. I'm updating the version as new CI builds are pushed to the apt repo and opening bugs when things seem broken.

Excerpt from my Dockerfile:

ENV DOTNET_VER "1.0.0-beta-002288"
ENV DOTNET_DEV_PKG "dotnet-dev-${DOTNET_VER}"
ENV DOTNET_HOST_PKG "dotnet-host=${DOTNET_VER}-1"
RUN bash -c "\
    apt-get update; apt-get upgrade -qqy && \
    apt-get install -qqy ${DOTNET_DEV_PKG} ${DOTNET_HOST_PKG} && \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"

colemickens avatar Apr 08 '16 01:04 colemickens

I cleaned these old host packages a couple days ago. I'm surprised to see this still happening.

Could somebody hitting this post the output of apt-cache policy dotnet-host ??

brthor avatar Apr 08 '16 02:04 brthor

Just a heads up, I had been using my workaround until just now and was basing my comments about apt still needing a clean from eye-balling the apt-mo listing in my browser. That having been said...

I just modified my Dockerfile from what is just above, to this:

ENV DOTNET_VER "1.0.0-beta-002288"
ENV DOTNET_DEV_PKG "dotnet-dev-${DOTNET_VER}"
RUN bash -c "\
    apt-get update; apt-get upgrade -qqy && \
    apt-get install -qqy ${DOTNET_DEV_PKG} && \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"

Running dotnet restore returns this:

Error loading hostpolicy 1.0.1-rc2-002296; interface mismatch between hostpolicy [32771] and hostfxr [32770]
Specifically, the structure of corehost_init_t has changed, do not know how to interpret it

After that, the result of apt-cache policy dotnet-host is:

dotnet-host:
  Installed: 1.0.1-dev-002315-1
  Candidate: 1.0.1-dev-002315-1
  Version table:
 *** 1.0.1-dev-002315-1 0
        100 /var/lib/dpkg/status

colemickens avatar Apr 08 '16 02:04 colemickens

So this ~~is~~ might be? the other case I mentioned above -- I'm installing an very slightly "older" version of dotnet-dev-beta, and it's pulling the latest (rather than much too old as before), and incompatible dotnet-host in.

colemickens avatar Apr 08 '16 02:04 colemickens

Looks like some rogue packages got pushed from the master branch to this feed now.

Disabled and will clean them out.

Thanks @colemickens !

brthor avatar Apr 08 '16 17:04 brthor

We are churning a bit right now, but the interface will be stable with PR dotnet/cli#2392

schellap avatar Apr 11 '16 16:04 schellap

Resolution: Upgrade app to beyond 002349 and make a clean install, i.e., remove older CLI versions. From now on you can have multiple sxs CLI and we'd be compatible.

schellap avatar Apr 15 '16 15:04 schellap