Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully fail when process cannot get exclusive database lock #7

Closed
m-beau opened this issue May 25, 2018 · 19 comments
Closed

Gracefully fail when process cannot get exclusive database lock #7

m-beau opened this issue May 25, 2018 · 19 comments
Labels
Bug Something isn't working Fixed

Comments

@m-beau
Copy link

m-beau commented May 25, 2018

A "database is locked" issue keeps happening to me, which suggests that there is an external soft trying to access my database. Though no obvious browser has OneDrive online open. Even if it did, this behavior would deserve a fix as well. Could be an app on a smartphone syncing in the background, maybe.

Here is my log for the command onedrive -m --debug-https --verbose, from the point when I add a new directory to the ~/onedrive directory (see this text file, the log is too long).

@abraunegg
Copy link
Owner

Can you provide the log but without --debug-https ?

Can you also confirm that when you are running your command, you do not have any other onedrive process running via init.d or systemd

@m-beau
Copy link
Author

m-beau commented May 27, 2018

Here it is

I ran my command after a system fresh start, no other command was ran before, no browser were open on my desktop either if this matters.

@abraunegg
Copy link
Owner

abraunegg commented May 27, 2018

I ran my command after a system fresh start

On fresh restart do you have 'onedrive' running as a system service?

no browser were open on my desktop either if this matters

Any open browsers has zero impact to the 'onedrive' client operating - they are two different application with zero interaction.

When you experience 'database is locked' when running the client manually, please provide the following output:

ps -aufx | grep onedrive
lsof | grep onedrive

@abraunegg
Copy link
Owner

abraunegg commented May 28, 2018

Interesting link re sqlite & 'database is locked'

http://beets.io/blog/sqlite-nightmare.html

So this was why some users saw this horrible behavior but I never did: all my systems have SQLite compiled with HAVE_USLEEP=1. Disassembling SQLite on my machine and the affected user’s confirmed the difference. Even though usleep is so old that it was obsoleted by nanosleep in 2001, the user’s SQLite had somehow been compiled assuming it did not exist.

The mystery was solved. And while one solution would be to berate the world’s software packagers into compiling SQLite with HAVE_USLEEP=1, we needed a nearer-term solution.

In my system where I test everything I use sqlite 3.7.15.2 from Fedora 19, rebuilt using mock for my target system. When it is built - usleep support is detected:

checking for usleep... yes

Can you provide what OS version your running & what sqlite versions you are running

@abraunegg
Copy link
Owner

@ms047
Any update?

@m-beau
Copy link
Author

m-beau commented May 30, 2018

Hey,

Here's my ps -aufx | grep onedrive output after having ran onedrive -m --verbose:

ms047    12734  0.0  0.0  14228  1056 pts/2    S+   17:55   0:00          |       \_ grep --color=auto onedrive
ms047    12729  3.1  0.0 199048 23452 ?        Ss   17:55   0:00  \_ /usr/local/bin/onedrive --monitor

and my lsof | grep onedrive output:

lsof: WARNING: can't stat() tracefs file system /sys/kernel/debug/tracing
      Output information may be incomplete.
onedrive  12796                     ms047  cwd       DIR                8,6      4096   18091898 /home/ms047/OneDrive
onedrive  12796                     ms047  rtd       DIR                8,5      4096          2 /
onedrive  12796                     ms047  txt       REG                8,5   6448096   12208472 /usr/local/bin/onedrive
onedrive  12796                     ms047  mem       REG                8,5     27000    5374045 /lib/x86_64-linux-gnu/libnss_dns-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     10480    5378630 /lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2
onedrive  12796                     ms047  mem       REG                8,5     39224    5378544 /lib/x86_64-linux-gnu/libcrypt-2.23.so
onedrive  12796                     ms047  mem       REG                8,5    304072   12067191 /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
onedrive  12796                     ms047  mem       REG                8,5     60928   12067173 /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
onedrive  12796                     ms047  mem       REG                8,5    166128   12067848 /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
onedrive  12796                     ms047  mem       REG                8,5     31104   12066906 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
onedrive  12796                     ms047  mem       REG                8,5     89904   12067589 /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
onedrive  12796                     ms047  mem       REG                8,5    204168   12067171 /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
onedrive  12796                     ms047  mem       REG                8,5    661872   12066608 /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
onedrive  12796                     ms047  mem       REG                8,5    560808   12067278 /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
onedrive  12796                     ms047  mem       REG                8,5     35920   12067175 /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
onedrive  12796                     ms047  mem       REG                8,5     14256    5378586 /lib/x86_64-linux-gnu/libkeyutils.so.1.5
onedrive  12796                     ms047  mem       REG                8,5     76192   12059969 /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1
onedrive  12796                     ms047  mem       REG                8,5    408472   12067465 /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0
onedrive  12796                     ms047  mem       REG                8,5    264256   12067094 /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
onedrive  12796                     ms047  mem       REG                8,5    109296   12067616 /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
onedrive  12796                     ms047  mem       REG                8,5    101200    5374039 /lib/x86_64-linux-gnu/libresolv-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     43664   12067282 /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
onedrive  12796                     ms047  mem       REG                8,5     14648    5378534 /lib/x86_64-linux-gnu/libcom_err.so.2.1
onedrive  12796                     ms047  mem       REG                8,5    186872   12067272 /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
onedrive  12796                     ms047  mem       REG                8,5    860392   12067280 /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
onedrive  12796                     ms047  mem       REG                8,5    522664   12067039 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
onedrive  12796                     ms047  mem       REG                8,5    219336   12067402 /usr/lib/x86_64-linux-gnu/libnettle.so.6.2
onedrive  12796                     ms047  mem       REG                8,5    207640   12067177 /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2
onedrive  12796                     ms047  mem       REG                8,5   1239440   12059521 /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
onedrive  12796                     ms047  mem       REG                8,5    104864    5378716 /lib/x86_64-linux-gnu/libz.so.1.2.8
onedrive  12796                     ms047  mem       REG                8,5    322928   12067293 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5
onedrive  12796                     ms047  mem       REG                8,5     59640   12067288 /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5
onedrive  12796                     ms047  mem       REG                8,5    301376   12067096 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
onedrive  12796                     ms047  mem       REG                8,5   2361856    5378447 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
onedrive  12796                     ms047  mem       REG                8,5    428384    5374993 /lib/x86_64-linux-gnu/libssl.so.1.0.0
onedrive  12796                     ms047  mem       REG                8,5    113584   12067597 /usr/lib/x86_64-linux-gnu/librtmp.so.1
onedrive  12796                     ms047  mem       REG                8,5    207208   12058935 /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
onedrive  12796                     ms047  mem       REG                8,5    452992   12058712 /usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0
onedrive  12796                     ms047  mem       REG                8,5     47600    5374048 /lib/x86_64-linux-gnu/libnss_files-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     47648    5378542 /lib/x86_64-linux-gnu/libnss_nis-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     93128    5373966 /lib/x86_64-linux-gnu/libnsl-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     35688    5374043 /lib/x86_64-linux-gnu/libnss_compat-2.23.so
onedrive  12796                     ms047  mem       REG                8,5   1868984    5374035 /lib/x86_64-linux-gnu/libc-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     89696    5378563 /lib/x86_64-linux-gnu/libgcc_s.so.1
onedrive  12796                     ms047  mem       REG                8,5     14608    5374037 /lib/x86_64-linux-gnu/libdl-2.23.so
onedrive  12796                     ms047  mem       REG                8,5     31712    5378543 /lib/x86_64-linux-gnu/librt-2.23.so
onedrive  12796                     ms047  mem       REG                8,5    138696    5373977 /lib/x86_64-linux-gnu/libpthread-2.23.so
onedrive  12796                     ms047  mem       REG                8,5    870240   12067675 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
onedrive  12796                     ms047  mem       REG                8,5    162632    5373969 /lib/x86_64-linux-gnu/ld-2.23.so
onedrive  12796                     ms047  mem-r     REG                8,6     32768    9830456 /home/ms047/.config/onedrive/items.sqlite3-shm
onedrive  12796                     ms047    0r      CHR                1,3       0t0          6 /dev/null
onedrive  12796                     ms047    1u     unix 0x0000000000000000       0t0      76142 type=STREAM
onedrive  12796                     ms047    2u     unix 0x0000000000000000       0t0      76142 type=STREAM
onedrive  12796                     ms047    3r      CHR                1,9       0t0         11 /dev/urandom
onedrive  12796                     ms047    4ur     REG                8,6  20245504    9830771 /home/ms047/.config/onedrive/items.sqlite3
onedrive  12796                     ms047    5u      REG                8,6         0    9830455 /home/ms047/.config/onedrive/items.sqlite3-wal
onedrive  12796                     ms047    6ur     REG                8,6     32768    9830456 /home/ms047/.config/onedrive/items.sqlite3-shm
onedrive  12796                     ms047    7u     IPv4              74106       0t0        TCP 128.40.127.140:51082->104.41.216.16:https (ESTABLISHED)
onedrive  12796                     ms047    8u     IPv4              74107       0t0        TCP 128.40.127.140:48150->51.140.114.4:https (ESTABLISHED)
onedrive  12796                     ms047    9r  a_inode               0,13         0      10118 inotify

My OS is Ubuntu 16.04
My sqlite version is 3.22.0 (sqlite3 --version output) - I'm not sure of how I can use the source you provided to fix the problem though?

The error happened again by the way, can't tell if it is anyhow different from the last one:

~$ onedrive -m --verbose
Loading config ...
Using Config Dir: /home/ms047/.config/onedrive
No config file found, using defaults
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /home/ms047/OneDrive
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: b!Hg_WDdcYG0uoqGbct0QH4cq_mr9qEhNIjhYCz52Sktk5R1GFLJ5qR6LJbCn7LW_r
Default Root ID: 01NQI5Y556Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 989281957182
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing monitor ...
Monitor directory: .
...
Applying changes of Path ID: 01NQI5Y556Y2GOVW7725BZO354PWSELRRZ
database is locked
Applying changes of Path ID: 01NQI5Y556Y2GOVW7725BZO354PWSELRRZ
database is locked
Applying changes of Path ID: 01NQI5Y556Y2GOVW7725BZO354PWSELRRZ
sqlite.SqliteException@src/sqlite.d(147): database is locked
----------------
src/sqlite.d:22 void sqlite.Statement.Result.step() [0x5a9d05]
src/sqlite.d:117 ref sqlite.Statement.Result sqlite.Statement.Result.__ctor(etc.c.sqlite3.sqlite3_stmt*) [0x5a9bcf]
src/sqlite.d:173 sqlite.Statement.Result sqlite.Statement.exec() [0x5a9ea1]
src/itemdb.d:116 void itemdb.ItemDatabase.upsert(ref const(itemdb.Item)) [0x58df71]
src/sync.d:430 void sync.SyncEngine.applyDifference(std.json.JSONValue, immutable(char)[], bool) [0x5abd03]
src/sync.d:375 void sync.SyncEngine.applyDifferences(immutable(char)[], const(char)[]) [0x5ab88a]
src/sync.d:183 void sync.SyncEngine.applyDifferences() [0x5aad09]
src/main.d:338 void main.performSync(sync.SyncEngine, immutable(char)[], bool, bool, bool) [0x593962]
src/main.d:281 _Dmain [0x59348f]

@abraunegg
Copy link
Owner

ms047 12729 3.1 0.0 199048 23452 ? Ss 17:55 0:00 \_ /usr/local/bin/onedrive --monitor

OK .. So you are running the 'onedrive' command manually whilst the service file for 'onedrive' is active and running ...

This is why you are seeing database is locked when trying to run the command again as the service has the database open already.

@m-beau
Copy link
Author

m-beau commented May 31, 2018

Do you mean that OneDrive is monitoring the local directory automatically, without any manual intervention required at startup? When I modify files in my local directory, they are not being uploaded though. I guess I could manually kill this process and run onedrive -m again, but this is quite odd.

Again, I literally turn on my computer, do not do anything else, and get this output for ps -aufx | grep onedrive:

ms047    17701  0.0  0.0  14228   984 pts/12   S+   13:51   0:00          |       \_ grep --color=auto onedrive
ms047    17678  1.1  0.0 199048 24144 ?        Ss   13:50   0:00  \_ /usr/local/bin/onedrive --monitor

Also, you could maybe make a specific error message raise and warn the user that the service file for 'onedrive' is active and running?

@abraunegg
Copy link
Owner

abraunegg commented May 31, 2018

Yes - you either have a systemd service configured or an init.d service configured to automatically start onedrive.

You must have configured this at some point.

Changing how the application handles the database lock to close out the error is how I was going to resolve this.

@abraunegg abraunegg added Bug Something isn't working and removed More Information Needed labels May 31, 2018
@abraunegg abraunegg changed the title Database is locked Gracefully fail when process cannot get exclusive database lock May 31, 2018
@m-beau
Copy link
Author

m-beau commented May 31, 2018

I re-installed onedrive several times and have not configured it on purpose if I actually did. Would you know how to check if a systemd service configured or an init.d service configured, and how to reconfigure them?

Thank you!

@abraunegg
Copy link
Owner

I would refer to this:

https://github.com/skilion/onedrive/wiki/Managing-the-onedrive-service

systemctl --user stop onedrive
systemctl --user disable onedrive

@abraunegg
Copy link
Owner

The 'database is locked' issue is resolved by 2576b69

When the application encounters this issue, it will now print the following message:

The database is currently locked by another process - cannot sync

@m-beau
Copy link
Author

m-beau commented Jun 2, 2018 via email

@abraunegg
Copy link
Owner

I’d also advise to print instructions to solve the problem, like “use
command xxx to kill the lrocess already open - it may be that your soft
opens at startup, to prevent this behavior from happening do yyy”

I think this is better serviced via a wiki page so when people are searching for the error they can find out what to do, rather than the program spit out some details which they may not quite understand / get.

If the patch provided resolves your issue, please can you close this case.

@abraunegg
Copy link
Owner

@ms047
Can you advise if the patch resolved your issue?

@m-beau
Copy link
Author

m-beau commented Jun 7, 2018

Hi,

Sorry I did not find the time to test that earlier - it seemed to work, i.e. some uploads and downloads were performed as expected. Nevertheless, I am quite certain not to have set the automatic launch of onedrive service at startup anywhere, so this may happen to other users. It keeps happening to me even after having reinstalled onedrive with your patch.

In this case, could you make onedrive automatically stop already opened services before starting? " systemctl --user stop onedrive" or "systemctl --user disable onedrive" could be automatically executed each time at the beginning, or something similar.

Also, this error keeps popping up after several up/downloads - I guess I should open a new issue for it:

Uploading file ./Societies/AMPS/Stats_Congres/EMPPCregistrants@05-19-2018-ms047-Precision-Tower-5810.pdf ... done.
Uploading file ./heyThere.txt ... done.
Uploading file ./123.txt ... done.
Unexpected character '<'. (Line 1:1)
<!DOCTYPE html>
<html>
    <head>
        <title>A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).</title>
        <meta name="viewport" content="width=device-width" />
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
         @media screen and (max-width: 639px) {
          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
         }
         @media screen and (max-width: 479px) {
          pre { width: 280px; }
         }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.
            <br><br>

            <b> Exception Details: </b>System.Web.HttpRequestValidationException: A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Stack Trace:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).]
   System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +11943859
   System.Web.HttpRequest.get_RawUrl() +78
   Microsoft.Online.AggregatorService.WebService.ContextHelper.GetIncomingUrl(HttpContextBase httpContext) in e:\bt\923520\repo\src\dev\WebService\ContextHelper.cs:196
   Microsoft.Online.AggregatorService.WebService.AuthenticationModule.InitializeAndGetLogContext(HttpContextWrapper currentContextWrapper) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:316
   Microsoft.Online.AggregatorService.WebService.AuthenticationModule.Context_BeginRequest(Object sender, EventArgs e) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:98
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +88
</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <hr width=100% size=1 color=silver>

            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0

            </font>

    </body>
</html>
<!-- 
[HttpRequestValidationException]: A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).
   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.get_RawUrl()
   at Microsoft.Online.AggregatorService.WebService.ContextHelper.GetIncomingUrl(HttpContextBase httpContext) in e:\bt\923520\repo\src\dev\WebService\ContextHelper.cs:line 196
   at Microsoft.Online.AggregatorService.WebService.AuthenticationModule.InitializeAndGetLogContext(HttpContextWrapper currentContextWrapper) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:line 316
   at Microsoft.Online.AggregatorService.WebService.AuthenticationModule.Context_BeginRequest(Object sender, EventArgs e) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:line 98
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!-- 
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->
Unexpected character '<'. (Line 1:1)
<!DOCTYPE html>
<html>
    <head>
        <title>A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).</title>
        <meta name="viewport" content="width=device-width" />
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
         @media screen and (max-width: 639px) {
          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
         }
         @media screen and (max-width: 479px) {
          pre { width: 280px; }
         }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.
            <br><br>

            <b> Exception Details: </b>System.Web.HttpRequestValidationException: A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Stack Trace:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).]
   System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +11943859
   System.Web.HttpRequest.get_RawUrl() +78
   Microsoft.Online.AggregatorService.WebService.ContextHelper.GetIncomingUrl(HttpContextBase httpContext) in e:\bt\923520\repo\src\dev\WebService\ContextHelper.cs:196
   Microsoft.Online.AggregatorService.WebService.AuthenticationModule.InitializeAndGetLogContext(HttpContextWrapper currentContextWrapper) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:316
   Microsoft.Online.AggregatorService.WebService.AuthenticationModule.Context_BeginRequest(Object sender, EventArgs e) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:98
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +88
</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <hr width=100% size=1 color=silver>

            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0

            </font>

    </body>
</html>
<!-- 
[HttpRequestValidationException]: A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).
   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.get_RawUrl()
   at Microsoft.Online.AggregatorService.WebService.ContextHelper.GetIncomingUrl(HttpContextBase httpContext) in e:\bt\923520\repo\src\dev\WebService\ContextHelper.cs:line 196
   at Microsoft.Online.AggregatorService.WebService.AuthenticationModule.InitializeAndGetLogContext(HttpContextWrapper currentContextWrapper) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:line 316
   at Microsoft.Online.AggregatorService.WebService.AuthenticationModule.Context_BeginRequest(Object sender, EventArgs e) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:line 98
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!-- 
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->
std.json.JSONException@std/json.d(1392): Unexpected character '<'. (Line 1:1)
<!DOCTYPE html>
<html>
    <head>
        <title>A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).</title>
        <meta name="viewport" content="width=device-width" />
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
         @media screen and (max-width: 639px) {
          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
         }
         @media screen and (max-width: 479px) {
          pre { width: 280px; }
         }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.
            <br><br>

            <b> Exception Details: </b>System.Web.HttpRequestValidationException: A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Stack Trace:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).]
   System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +11943859
   System.Web.HttpRequest.get_RawUrl() +78
   Microsoft.Online.AggregatorService.WebService.ContextHelper.GetIncomingUrl(HttpContextBase httpContext) in e:\bt\923520\repo\src\dev\WebService\ContextHelper.cs:196
   Microsoft.Online.AggregatorService.WebService.AuthenticationModule.InitializeAndGetLogContext(HttpContextWrapper currentContextWrapper) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:316
   Microsoft.Online.AggregatorService.WebService.AuthenticationModule.Context_BeginRequest(Object sender, EventArgs e) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:98
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +88
</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <hr width=100% size=1 color=silver>

            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0

            </font>

    </body>
</html>
<!-- 
[HttpRequestValidationException]: A potentially dangerous Request.RawUrl value was detected from the client (=&quot;...ticles pre&amp;#769;paration Conco...&quot;).
   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.get_RawUrl()
   at Microsoft.Online.AggregatorService.WebService.ContextHelper.GetIncomingUrl(HttpContextBase httpContext) in e:\bt\923520\repo\src\dev\WebService\ContextHelper.cs:line 196
   at Microsoft.Online.AggregatorService.WebService.AuthenticationModule.InitializeAndGetLogContext(HttpContextWrapper currentContextWrapper) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:line 316
   at Microsoft.Online.AggregatorService.WebService.AuthenticationModule.Context_BeginRequest(Object sender, EventArgs e) in e:\bt\923520\repo\src\dev\WebService\AuthenticationModule.cs:line 98
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!-- 
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->
----------------
/usr/include/dmd/phobos/std/json.d:726 pure @safe void std.json.parseJSON!(char[]).parseJSON(char[], int, std.json.JSONOptions).error(immutable(char)[]) [0x5a2c10]
/usr/include/dmd/phobos/std/json.d:1067 pure @safe void std.json.parseJSON!(char[]).parseJSON(char[], int, std.json.JSONOptions).parseValue(ref std.json.JSONValue) [0x5a37eb]
/usr/include/dmd/phobos/std/json.d:1073 pure @safe std.json.JSONValue std.json.parseJSON!(char[]).parseJSON(char[], int, std.json.JSONOptions) [0x5a2bad]
src/onedrive.d:429 std.json.JSONValue onedrive.OneDriveApi.perform() [0x5a240a]
src/onedrive.d:311 std.json.JSONValue onedrive.OneDriveApi.get(const(char)[], bool) [0x5a1c8e]
src/onedrive.d:188 std.json.JSONValue onedrive.OneDriveApi.getPathDetails(const(immutable(char)[])) [0x5a121b]
src/sync.d:1000 void sync.SyncEngine.uploadNewFile(immutable(char)[]) [0x5aeabb]
src/sync.d:880 void sync.SyncEngine.uploadNewItems(immutable(char)[]) [0x5ae1ef]
src/sync.d:871 void sync.SyncEngine.uploadNewItems(immutable(char)[]) [0x5ae0e6]
src/sync.d:871 void sync.SyncEngine.uploadNewItems(immutable(char)[]) [0x5ae0e6]
src/sync.d:871 void sync.SyncEngine.uploadNewItems(immutable(char)[]) [0x5ae0e6]
src/sync.d:871 void sync.SyncEngine.uploadNewItems(immutable(char)[]) [0x5ae0e6]
src/sync.d:681 void sync.SyncEngine.scanForDifferences(immutable(char)[]) [0x5ad2b5]
src/main.d:340 void main.performSync(sync.SyncEngine, immutable(char)[], bool, bool, bool) [0x593c4f]
src/main.d:231 _Dmain [0x59361f]

@abraunegg
Copy link
Owner

Nevertheless, I am quite certain not to have set the automatic launch of onedrive service at startup anywhere, so this may happen to other users. It keeps happening to me even after having reinstalled onedrive with your patch.

In this case, could you make onedrive automatically stop already opened services before starting? " systemctl --user stop onedrive" or "systemctl --user disable onedrive" could be automatically executed each time at the beginning, or something similar.

Your OS must be automatically configuring installed unit files to start on system boot. The Makefile simply copies the files over but does not activate or start them. It sounds like you need to raise a case with the folk that support your OS.

Unexpected character '<'. (Line 1:1)

This to me sound like you have some sort of gateway content filtering going on that is parsing the content or that there is something going on with the Microsoft Graph service. I would first check to see if you have any gateway content filtering going on and if not raise a case against the OneDrive API

@abraunegg
Copy link
Owner

Closing issue. Original issue of 'database is locked' is resolved, other items are environmental and outside of realm to resolve.

@lock
Copy link

lock bot commented Jan 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed
Projects
None yet
Development

No branches or pull requests

2 participants