{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3359","repository_url":"https://api.github.com/repos/Starcounter/Starcounter","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3359/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3359/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3359/events","html_url":"https://github.com/Starcounter/Starcounter/issues/3359","id":132833169,"number":3359,"title":"pnext: ScErrUnexpMetadata (SCERR7035): Internal error in unmanaged meta-data population","user":{"login":"dan31","id":7162535,"avatar_url":"https://avatars.githubusercontent.com/u/7162535?v=3","gravatar_id":"","url":"https://api.github.com/users/dan31","html_url":"https://github.com/dan31","followers_url":"https://api.github.com/users/dan31/followers","following_url":"https://api.github.com/users/dan31/following{/other_user}","gists_url":"https://api.github.com/users/dan31/gists{/gist_id}","starred_url":"https://api.github.com/users/dan31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan31/subscriptions","organizations_url":"https://api.github.com/users/dan31/orgs","repos_url":"https://api.github.com/users/dan31/repos","events_url":"https://api.github.com/users/dan31/events{/privacy}","received_events_url":"https://api.github.com/users/dan31/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/P/SHOWSTOPPER","name":"P/SHOWSTOPPER","color":"FF0000"}],"state":"open","locked":false,"assignee":{"login":"alexanderstc","id":12279020,"avatar_url":"https://avatars.githubusercontent.com/u/12279020?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderstc","html_url":"https://github.com/alexanderstc","followers_url":"https://api.github.com/users/alexanderstc/followers","following_url":"https://api.github.com/users/alexanderstc/following{/other_user}","gists_url":"https://api.github.com/users/alexanderstc/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderstc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderstc/subscriptions","organizations_url":"https://api.github.com/users/alexanderstc/orgs","repos_url":"https://api.github.com/users/alexanderstc/repos","events_url":"https://api.github.com/users/alexanderstc/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderstc/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/59","html_url":"https://github.com/Starcounter/Starcounter/milestones/pnext","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/59/labels","id":1449205,"number":59,"title":"pnext","description":"","creator":{"login":"dan31","id":7162535,"avatar_url":"https://avatars.githubusercontent.com/u/7162535?v=3","gravatar_id":"","url":"https://api.github.com/users/dan31","html_url":"https://github.com/dan31","followers_url":"https://api.github.com/users/dan31/followers","following_url":"https://api.github.com/users/dan31/following{/other_user}","gists_url":"https://api.github.com/users/dan31/gists{/gist_id}","starred_url":"https://api.github.com/users/dan31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan31/subscriptions","organizations_url":"https://api.github.com/users/dan31/orgs","repos_url":"https://api.github.com/users/dan31/repos","events_url":"https://api.github.com/users/dan31/events{/privacy}","received_events_url":"https://api.github.com/users/dan31/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":51,"state":"open","created_at":"2015-12-08T04:55:49Z","updated_at":"2016-02-12T16:07:30Z","due_on":"2015-12-18T08:00:00Z","closed_at":null},"comments":19,"created_at":"2016-02-10T22:21:24Z","updated_at":"2016-02-12T23:52:40Z","closed_at":null,"body":"After starting and stopping some apps, but not changing the class schemas, the database is in the following state at an attempt to start a database with no apps autostarted:\r\n```\r\nSystem.Exception: ScErrUnexpMetadata (SCERR7035): Internal error in unmanaged meta-data population.\r\nVersion: 2.3.797.\r\nHelp page: https://github.com/Starcounter/Starcounter/wiki/SCERR7035.\r\n   at Starcounter.SqlProcessor.SqlProcessor.MetalayerThrowIfError(UInt32 err) in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Starcounter\\SqlProcessor\\SqlProcessor.cs:line 282\r\n   at Starcounter.SqlProcessor.SqlProcessor.PopulateRuntimeMetadata() in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Starcounter\\SqlProcessor\\SqlProcessor.cs:line 181\r\n   at Starcounter.Hosting.StarcounterPackage.UpdateDatabaseSchemaAndRegisterTypes(String fullAppId, TypeDef[] unregisteredTypeDefs, TypeDef[] allTypeDefs) in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Hosting\\Starcounter.Hosting\\StarcounterPackage.cs:line 43\r\n   at Starcounter.Hosting.Package.ProcessWithinCurrentApplication(Application application) in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Hosting\\Starcounter.Hosting\\Package.cs:line 261\r\n   at Starcounter.Hosting.Package.Process() in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Hosting\\Starcounter.Hosting\\Package.cs:line 143\r\n   at Starcounter.Hosting.Package.Process(IntPtr hPackage) in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Hosting\\Starcounter.Hosting\\Package.cs:line 56\r\n   at StarcounterInternal.Hosting.Processor.RunMessageLoop(Void* hsched) in C:\\TeamCity\\TeamCity9\\buildAgent\\work\\sc-53\\Level1\\src\\Hosting\\Starcounter.Hosting\\Processor.cs:line 90\r\nHResult=-2146233088\r\nHelpLink=https://github.com/Starcounter/Starcounter/wiki/SCERR7035\r\n```\r\nUploaded are three apps used and a database entire repository: http://rghost.net/8nsVw2qnC\r\nCC @eriohl @k-rus @bigwad "},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/183532441","html_url":"https://github.com/Starcounter/Starcounter/issues/3359#issuecomment-183532441","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3359","id":183532441,"user":{"login":"dan31","id":7162535,"avatar_url":"https://avatars.githubusercontent.com/u/7162535?v=3","gravatar_id":"","url":"https://api.github.com/users/dan31","html_url":"https://github.com/dan31","followers_url":"https://api.github.com/users/dan31/followers","following_url":"https://api.github.com/users/dan31/following{/other_user}","gists_url":"https://api.github.com/users/dan31/gists{/gist_id}","starred_url":"https://api.github.com/users/dan31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan31/subscriptions","organizations_url":"https://api.github.com/users/dan31/orgs","repos_url":"https://api.github.com/users/dan31/repos","events_url":"https://api.github.com/users/dan31/events{/privacy}","received_events_url":"https://api.github.com/users/dan31/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T23:52:40Z","updated_at":"2016-02-12T23:52:40Z","body":"@alexanderstc, I tried it with ```v2.3.826```, I confirm it doesn't improve the situation. The way to reproduce is to try starting the code below from VS (F5 + Debug x64) atop empty database. First time it usually starts okay, next time it takes infinite time to start (race condition?), so that I have to kill processes. After that situation, I get same exception. That is an app I have:\r\n```\r\nusing System;\r\nusing Starcounter;\r\nusing System.Threading;\r\n\r\nnamespace Bulker {\r\n    [Database]\r\n    public class Record {\r\n        public ulong oid;\r\n        public ulong oidSum;\r\n        public string origin;\r\n    }\r\n    class Program {\r\n        static ulong CalcSum(string origin) {\r\n            var rs = Db.SQL(\"select r from Record r where r.origin=?\", origin);\r\n            ulong sum = 0;\r\n            foreach (var r in rs)\r\n                sum += r.GetObjectNo();\r\n            return sum;\r\n        }\r\n\r\n        static ulong CalcCount(string origin) {\r\n            return (UInt64) Db.SlowSQL<Int64>(\"select count(r) from Record r where r.origin=?\", origin).First;\r\n        }\r\n\r\n        static bool Check(string origin) {\r\n            ulong oidSum = 0;\r\n            ulong maxOid = 0;\r\n            var records = Db.SQL(\"select p from Record p where p.origin=?\", origin);\r\n            if (CalcCount(origin) == 0) return true;\r\n            foreach (Record record in records) {\r\n                if (record.oid > maxOid)\r\n                    maxOid = record.oid;\r\n                if (record.oid != record.GetObjectNo()) {\r\n                    Console.WriteLine(\"No integrity on: localOID={0}, originOID={1}\", record.GetObjectNo(), record.oid);\r\n                    return false;\r\n                }\r\n                oidSum += record.GetObjectNo();\r\n            }\r\n            Record mr = (Record)DbHelper.FromID(maxOid);\r\n            if (mr.oidSum != oidSum) {\r\n                Console.WriteLine(\"No integrity on: localSum={0}, originSum={1}\", oidSum, mr.oidSum);\r\n            }\r\n            Console.WriteLine(\"Integrity check for sum={0} maxOid={1} sucessful\", oidSum, maxOid);\r\n            return true;\r\n        }\r\n\r\n        static void Main() {\r\n            Thread.Sleep(10000);\r\n            string orig = \"ground\";\r\n            ulong oidSum = CalcSum(orig);\r\n            ulong cntr = CalcCount(orig);\r\n            while (true) {\r\n                for (int i = 1; i <= 10; ++i) {\r\n                    Db.Transact(() => {\r\n                        var p = new Record();\r\n                        p.oid = p.GetObjectNo();\r\n                        p.origin = orig;\r\n                        oidSum += p.oid;\r\n                        p.oidSum = oidSum;\r\n                        cntr++;\r\n                    });\r\n                }\r\n                Console.WriteLine(\"Inserted are {0} objects, sum = {1}\", cntr, oidSum);\r\n                Thread.Sleep(500);\r\n                Check(\"vessel\");\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n@alexanderstc, whether you have hard time to reproduce the situation, ask me to give you access to a machine where I have it reproducible. @k-rus @alexanderstc I raise it to a showstopper bug, if you have nothing against, since I don't see how to get data from the database in the state."}}