Bug 421507 - "Meta File Error, root contains invalid metadata" when trying to migrate to simple metastore
Summary: "Meta File Error, root contains invalid metadata" when trying to migrate to s...
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Server (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 5.0 M1   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-12 04:35 EST by Szymon Brandys CLA
Modified: 2013-11-18 15:38 EST (History)
2 users (show)

See Also:


Attachments
Migration Log (5.44 KB, application/octet-stream)
2013-11-12 11:10 EST, Malgorzata Janczarska CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2013-11-12 04:35:31 EST
I tried steps from https://wiki.eclipse.org/Orion/Metadata_migration#Orion_4.0_Migration to migrate my local Orion workspace.

My console says this:

osgi> 2013-11-12 10:31:43.553 [Worker-0] INFO  org.eclipse.orion.server.config - Initializing server metadata store
2013-11-12 10:31:43.590 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/.jazz5
2013-11-12 10:31:43.591 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/.jazzShed
2013-11-12 10:31:43.591 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/.project
2013-11-12 10:31:43.591 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/bundles
2013-11-12 10:31:43.595 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/CloudyTweeter
2013-11-12 10:31:43.595 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/compile-and-test
2013-11-12 10:31:43.595 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/extras
2013-11-12 10:31:43.595 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/features
2013-11-12 10:31:43.596 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/log.txt
2013-11-12 10:31:43.596 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/optimization
2013-11-12 10:31:43.596 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/pom.xml
2013-11-12 10:31:43.596 [Worker-0] WARN  org.eclipse.orion.server.config - Meta File Error, root contains invalid metadata: folder C:\home\workspaces\foo_ps100\a/project.json
Comment 1 Szymon Brandys CLA 2013-11-12 04:36:06 EST
Gosia seems to have the same issue.
Comment 2 Anthony Hunter CLA 2013-11-12 10:35:02 EST
The warning indicates that the folder C:\home\workspaces\foo_ps100\a does not belong to any user. Can you confirm?
Comment 3 Malgorzata Janczarska CLA 2013-11-12 10:42:42 EST
(In reply to Anthony Hunter from comment #2)
> The warning indicates that the folder C:\home\workspaces\foo_ps100\a does
> not belong to any user. Can you confirm?

I don't think C:\home\workspaces\foo_ps100\a is a workspace. "C:\home\workspaces\foo_ps100" is a workspace and "a" is the project in this workspace.
Note that "C:\home\workspaces\foo_ps100" is a general workspace for Orion that has all the Orion projects inside, regardless to which user they belong.
Comment 4 Malgorzata Janczarska CLA 2013-11-12 11:10:45 EST
Created attachment 237399 [details]
Migration Log

This is my migration log.
Comment 5 Anthony Hunter CLA 2013-11-12 14:44:59 EST
Problem one is that you have a username "A". The orion UI is supposed to prevent you from creating a username less than three characters long. As a result, I am pretty sure the userid a is overwriting the project a during migration. Can you delete this user from http://localhost:8080/profile/user-list.html? This needs to be investigated further.

Problem two is the messages:
ERROR: Did not migrate user: no entry in secure storage for userId: mtomczyk1
This indicates that there are users in User.pref but not in the secure_store, which should not be the case. Know how this happened? Was the server workspace corrupted at some time?

Problem three is the project names like "sbrandys | SB1", these project names are not valid the way the code is written now. I guess you used to be able to put whatever funny characters you wanted into the project name in the past. This needs to be investigated further, but the "|" needs to be removed from project names.
Comment 6 Anthony Hunter CLA 2013-11-13 16:28:34 EST
(In reply to Anthony Hunter from comment #5)
> Problem two is the messages:
> ERROR: Did not migrate user: no entry in secure storage for userId: mtomczyk1
> This indicates that there are users in User.pref but not in the
> secure_store, which should not be the case. Know how this happened? Was the
> server workspace corrupted at some time?

This problem is fixed by Bug 421676 .
Comment 7 Anthony Hunter CLA 2013-11-13 16:35:27 EST
(In reply to Anthony Hunter from comment #5)
> Problem one is that you have a username "A". The orion UI is supposed to
> prevent you from creating a username less than three characters long. As a
> result, I am pretty sure the userid a is overwriting the project a during
> migration. Can you delete this user from
> http://localhost:8080/profile/user-list.html? This needs to be investigated
> further.

With the legacy meta store, the first project you create is stored under {serverworkspace}/A. During migration, since the user is named "A", we also want to put user files under {serverworkspace}/A. (The user home would actually be {serverworkspace}/A/A). I am not exactly sure how to support this conflict.

For now, I will add a note to the migration document that user names must be three or more characters long. Users like "A" need to be renamed before migration. Hopefully this is just a development environment user and not something that would be encountered in the wild.
Comment 8 Anthony Hunter CLA 2013-11-13 16:37:34 EST
(In reply to Anthony Hunter from comment #5)
> Problem three is the project names like "sbrandys | SB1", these project
> names are not valid the way the code is written now. I guess you used to be
> able to put whatever funny characters you wanted into the project name in
> the past. This needs to be investigated further, but the "|" needs to be
> removed from project names.

This is in fact not a problem on Linux and the project name "sbrandys | SB1" appears to work fine after some brief testing.

"|" is a reserved character on Windows, so we need to handle. "|" can be saved to disk as some other character string.
Comment 9 Anthony Hunter CLA 2013-11-14 13:58:41 EST
(In reply to Anthony Hunter from comment #8)
> (In reply to Anthony Hunter from comment #5)
> > Problem three is the project names like "sbrandys | SB1", these project
> > names are not valid the way the code is written now. I guess you used to be
> > able to put whatever funny characters you wanted into the project name in
> > the past. This needs to be investigated further, but the "|" needs to be
> > removed from project names.
> 
> This is in fact not a problem on Linux and the project name "sbrandys | SB1"
> appears to work fine after some brief testing.
> 
> "|" is a reserved character on Windows, so we need to handle. "|" can be
> saved to disk as some other character string.

This problem is resolved with Bug 421763 .
Comment 10 Anthony Hunter CLA 2013-11-14 16:36:40 EST
(In reply to Anthony Hunter from comment #7)
> (In reply to Anthony Hunter from comment #5)
> > Problem one is that you have a username "A". The orion UI is supposed to
> > prevent you from creating a username less than three characters long. As a
> > result, I am pretty sure the userid a is overwriting the project a during
> > migration. Can you delete this user from
> > http://localhost:8080/profile/user-list.html? This needs to be investigated
> > further.
> 
> With the legacy meta store, the first project you create is stored under
> {serverworkspace}/A. During migration, since the user is named "A", we also
> want to put user files under {serverworkspace}/A. (The user home would
> actually be {serverworkspace}/A/A). I am not exactly sure how to support
> this conflict.
> 
> For now, I will add a note to the migration document that user names must be
> three or more characters long. Users like "A" need to be renamed before
> migration. Hopefully this is just a development environment user and not
> something that would be encountered in the wild.

The concern about:
Processing UserId A (1 of 8) UserName A

In Orion 0.2 you could create a user with login "A" and in addition you did not need to specify a user name so it could be blank. I have verified that this user migrates properly with workspaces in 0.2 using both orion.file.layout=userTree and orion.file.layout=flat on Linux. This depends on the fact that the account login is changed to lower case 'a' and does not conflict with the project folder 'A'.

On Windows this will fail, since 'a' and 'A' map to the same folder, as the Windows file system is not case sensitive. 

Since this type of userId is not supported post 0.2, I have noted this issue on the migration page at https://wiki.eclipse.org/Orion/Metadata_migration#Notes_2
Comment 11 Anthony Hunter CLA 2013-11-14 16:38:38 EST
I have addressed all three issues I can see with the serverworkspaces, please try migration again and let me know if it breaks.
Comment 12 Malgorzata Janczarska CLA 2013-11-15 05:04:32 EST
Migration still fails for user "A", but I understand that this user should be removed or renamed. I removed this user, but migration still failed for 4 projects in my WS. I'm sending you logs my email because those where not opensource projects and I don't want to publish their content.
Comment 13 Anthony Hunter CLA 2013-11-18 15:38:02 EST
(In reply to Malgorzata Janczarska from comment #12)
> Migration still fails for user "A", but I understand that this user should
> be removed or renamed. I removed this user, but migration still failed for 4
> projects in my WS. I'm sending you logs my email because those where not
> opensource projects and I don't want to publish their content.

This additional problem was solved with Bug 421676.