Dynalon / Rainy

Simple Tomboy/Tomdroid cloud/syncing server. Written in C# with AngularJS web frontend. Supports SQLite & Postgres Backends.
http://dynalon.github.io/Rainy
GNU Affero General Public License v3.0
88 stars 15 forks source link

Missing user and can't recreate user. #55

Open Enkouyami opened 8 years ago

Enkouyami commented 8 years ago

I've been using v0.5.0 of Rainy for several month's without issue and my tomboy client is at v1.15.4. After two months of not using the server installed on Ubuntu 15.10, I decided to start up that server, and sync up my notes saved on the server with a new Ubuntu 16.04 client running tomboy 1.15.4. On tomboy I set it to sync on tomboy web with my server's ip, port, my user's credentials, and it failed.

I went to the web interface for Rainy and logged on using my admin password and I saw that there was no longer any registered users. I restarted the Rainy server and same result occurred. I opened my rainy database with DB Browser for SQLite and saw that all my notes was still there.

I went back to the web UI and remade the user, marked it as active, attempted to sign in as that user, but it failed. I tried making a new user and signing in as that worked. I deleted my original user, remade it, and I still was unable to log in. When I do this is what the debug log shows:

16/04/29_23:16:11.979 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request headers:

16/04/29_23:16:11.980 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Host: localhost:8080
16/04/29_23:16:11.980 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0
16/04/29_23:16:11.981 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept: application/json, text/plain, */*
16/04/29_23:16:11.982 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Language: en-US,en;q=0.5
16/04/29_23:16:11.983 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Encoding: gzip, deflate
16/04/29_23:16:11.983 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Content-Type: application/json;charset=utf-8
16/04/29_23:16:11.984 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Referer: http://localhost:8080/
16/04/29_23:16:11.984 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Content-Length: 61
16/04/29_23:16:11.985 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Connection: keep-alive
16/04/29_23:16:11.987 [DEBUG] Rainy.WebService.OAuth.OAuthAuthenticateService->Post - Operation is not valid due to the current state of the object.

On the ubuntu computer that has the server, I also had previously set up tomboy sync with that old user and choose to "Synchronize Now" and the debug log showed this (I restarted the server before syncing):

16/04/29_23:27:50.146 [DEBUG] Main->SetupLogging - logsystem initialized
16/04/29_23:27:50.240 [DEBUG] Main->SetupLogging - Writing all log messages to file: debug.log
16/04/29_23:27:51.516 [DEBUG] Rainy.RainyStandaloneServer->Start - starting http listener at: http://*:8080/
16/04/29_23:27:56.219 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request at: /api/admin/alluser/
Deserialized data (JSV):
{

}
16/04/29_23:27:56.225 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request headers:

16/04/29_23:27:56.226 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Host: localhost:8080
16/04/29_23:27:56.227 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0
16/04/29_23:27:56.227 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept: */*
16/04/29_23:27:56.228 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Language: en-US,en;q=0.5
16/04/29_23:27:56.229 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Encoding: gzip, deflate
16/04/29_23:27:56.229 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    X-Requested-With: XMLHttpRequest
16/04/29_23:27:56.232 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Referer: http://localhost:8080/admin/
16/04/29_23:27:56.234 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Connection: keep-alive
16/04/29_23:28:01.788 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request at: /api/admin/alluser/
Deserialized data (JSV):
{

}
16/04/29_23:28:01.789 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request headers:

16/04/29_23:28:01.789 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Host: localhost:8080
16/04/29_23:28:01.790 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0
16/04/29_23:28:01.791 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept: */*
16/04/29_23:28:01.793 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Language: en-US,en;q=0.5
16/04/29_23:28:01.793 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Encoding: gzip, deflate
16/04/29_23:28:01.795 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    X-Requested-With: XMLHttpRequest
16/04/29_23:28:01.796 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Referer: http://localhost:8080/admin/
16/04/29_23:28:01.796 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Connection: keep-alive
16/04/29_23:28:02.014 [DEBUG] Rainy.WebService.ResponseLogFilterAttribute->ResponseFilter - Unserialized response data to send (JSV):
[
    {
        Username: enkouyami,
        Password: ,
        EmailAddress: enkouyami@gmail.com,
        AdditionalData: ,
        IsVerified: True,
        IsActivated: True
    }
]
16/04/29_23:28:02.052 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request at: /api/admin/status/
Deserialized data (JSV):
{

}
16/04/29_23:28:02.057 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request headers:

16/04/29_23:28:02.058 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Host: localhost:8080
16/04/29_23:28:02.058 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0
16/04/29_23:28:02.059 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept: */*
16/04/29_23:28:02.060 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Language: en-US,en;q=0.5
16/04/29_23:28:02.060 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Accept-Encoding: gzip, deflate
16/04/29_23:28:02.061 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    X-Requested-With: XMLHttpRequest
16/04/29_23:28:02.061 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Referer: http://localhost:8080/admin/
16/04/29_23:28:02.062 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Connection: keep-alive
16/04/29_23:28:02.125 [DEBUG] Rainy.WebService.ResponseLogFilterAttribute->ResponseFilter - Unserialized response data to send (JSV):
{
    Uptime: 2016-04-29T23:27:51.560869Z,
    NumberOfUser: 1,
    NumberOfRequests: 0,
    TotalNumberOfNotes: 0,
    AverageNotesPerUser: 0
}
16/04/29_23:29:10.853 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request at: /api/1.0/
Deserialized data (JSV):
{

}
16/04/29_23:29:10.854 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter - Received request headers:

16/04/29_23:29:10.857 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Authorization: OAuth realm="Snowy",oauth_consumer_key="anyone",oauth_nonce="2892168",oauth_signature="2GjyQ6JlnExt1AeUw1QYWLUujO0%3d",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1461972550",oauth_token="7dc4aaabba84acb7ef00a88688014b2d498b1296c4281847ab44174351bb40c7198fc8516cd527156902a482165ea1746cced966edba2a7e211d91b98dc6e9420d9b19ab3124fba725010f397569800c",oauth_version="1.0"
16/04/29_23:29:10.862 [DEBUG] Rainy.WebService.RequestLogFilterAttribute->RequestFilter -    Host: localhost:8080
16/04/29_23:29:10.972 [DEBUG] Rainy.ErrorHandling.ExceptionHandler->HandleException - Value cannot be null.
Parameter name: DBAccessToken: 'WHERE ("Token" = '7dc4aaabba84acb7ef00a886')' does not exist
16/04/29_23:29:10.983 [DEBUG] Rainy.ErrorHandling.ExceptionHandler->LogExceptionDetails -   at ServiceStack.OrmLite.ReadExtensions.First[T] (IDbCommand dbCmd, ServiceStack.OrmLite.SqlExpressionVisitor`1 expression) <0x41ebe4a0 + 0x000d3> in <filename unknown>:0 
  at ServiceStack.OrmLite.ReadExtensions.First[T] (IDbCommand dbCmd, System.Linq.Expressions.Expression`1 predicate) <0x41eba910 + 0x0008b> in <filename unknown>:0 
  at ServiceStack.OrmLite.ReadConnectionExtensions+<>c__DisplayClass19`1[T].<First>b__18 (IDbCommand dbCmd) <0x41eba8c0 + 0x0003b> in <filename unknown>:0 
  at ServiceStack.OrmLite.ReadConnectionExtensions.Exec[T] (IDbConnection dbConn, System.Func`2 filter) <0x41e8c500 + 0x00155> in <filename unknown>:0 
  at ServiceStack.OrmLite.ReadConnectionExtensions.First[T] (IDbConnection dbConn, System.Linq.Expressions.Expression`1 predicate) <0x41eba730 + 0x0010b> in <filename unknown>:0 
  at Rainy.OAuth.DbAccessTokenRepository`1[T].GetToken (System.String token) [0x00035] in /home/timo/Rainy/Rainy/WebService/OAuth/OAuthDataStructures.cs:86 
  at Rainy.WebService.ApiService.Get (Rainy.WebService.ApiRequest request) [0x000ac] in /home/timo/Rainy/Rainy/WebService/ApiService.cs:37 
  at (wrapper dynamic-method) System.Object:lambda_method (System.Runtime.CompilerServices.Closure,object,object)
  at ServiceStack.ServiceHost.ServiceRunner`1[TRequest].Execute (IRequestContext requestContext, System.Object instance, ServiceStack.ServiceHost.TRequest request) <0x41e7b500 + 0x002ab> in <filename unknown>:0
Enkouyami commented 8 years ago

Re-downloading Rainy and setting it up with the same settings fixes this issue, but why did it happen in the first place?