# Unable to specify path when using google drive

**URL:** <https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891>\
**Category:** Support\
**Created:** [August 17, 2021, 8:49pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891 "2021-08-17T20:49:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrgbistro](https://forum.duplicati.com/user_avatar/forum.duplicati.com/nrgbistro/32/6079_2.png) [@nrgbistro](https://forum.duplicati.com/u/nrgbistro)\
**Post date:** [August 17, 2021, 8:49pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/1 "2021-08-17T20:49:26Z")

</div>

When I choose google drive as my backup location, I’m able to get a working test connection when I specify no path. However, if I try to specify any path (whether it exists on my google drive account already or not), I get `Failed to connect: Internal Server Error`.

How can I diagnose what’s going on? For now I’m just uploading directly to the root directory but this isn’t ideal.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [August 19, 2021, 6:47pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/2 "2021-08-19T18:47:35Z")

</div>

Welcome to the forum @nrgbistro

> [@nrgbistro](#):
>
> How can I diagnose what’s going on?

This appears to be an internal server error from Google. Hard to know reason.

What OS is this, and does a simple path (e.g. just a name, no slashes) error?

From Windows (and probably from anything), a backslash gives me this error:

![image](https://forum.duplicati.com/uploads/default/original/2X/e/e78427862238855a69d054de8dca993c604201b8.png)

and if I try a similar test using [Duplicati.CommandLine.BackendTool.exe](https://duplicati.readthedocs.io/en/latest/07-other-command-line-utilities/#duplicaticommandlinebackendtoolexe) `list` with a URL from an  
[Export As Command-line](https://duplicati.readthedocs.io/en/latest/03-using-the-graphical-user-interface/#exporting-a-backup-job-configuration) (then edit that to use a backslash, making it illegal), I get the same error.

If I try to get more information using not-so-easy Windows .NET Framework [network tracing](https://forum.duplicati.com/t/google-drive-500-internal-server-error/5218/2), I see:

```plaintext
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid query",
    "locationType": "parameter",
    "location": "q"
   }
  ],
  "code": 400,
  "message": "Invalid query"
 }
}

```

after finding the detailed response in the unencrypted data, and putting it all back together to post here.  
In this case, no additional information, but there’s a chance (maybe not great) your case will see more.

[Google Drive: 500 internal server error](https://forum.duplicati.com/t/google-drive-500-internal-server-error/5218)  
were some 2018 cases, and the road to success was to wait for Google to fix the internal server error.  
There were some other ideas there that may or may not help you resolve whatever’s failing at Google.

> [@nrgbistro](#):
>
> whether it exists on my google drive account already or not

is possibly significant (but maybe only to Google). Duplicati by default shouldn’t even be able to see any folder that it didn’t create. This is a Google security feature. You can wind up with the same folder twice.

> [@nrgbistro](#):
>
> For now I’m just uploading directly to the root directory

You should be able to see in the details box at the right of your screen that Duplicati created the files, e.g.

![image](https://forum.duplicati.com/uploads/default/original/2X/6/69868bf88658471f3afc15967d259165587a0765.png)

and you can compare that with the creation of the folder you’re trying to get to, to see if it would be seen,  
but quite possibly the processing never got as far as looking at the characteristics of the specified folder.

Is this a simple personal Google Drive account? That’s what I use. I don’t know much about fancy types.

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 30, 2022, 10:47pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/3 "2022-05-30T22:47:18Z")

</div>

@ts678 I’ve got the exact same problem on 2.0.6.3\_beta\_2021-06-17 and Ubuntu 20.04. This makes Google Drive a bit unusable. I see nothing in my logs but in the HTTP response I get

```nohighlight
{
  "Error": "missing-folder"
}

```

Of course the folder does exist. I tried with slashes, without, without pre-creating the folder… But nope. Connection and backup is fine when field is empty though.  
IMO this is a bug since Duplicacy has no problem backuping to a specific pre-existing folder on Drive.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 30, 2022, 11:57pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/4 "2022-05-30T23:57:26Z")

</div>

> [@lmey](#):
>
> Of course the folder does exist

What created it? Duplicati’s default is a more secure option where it only sees folders it created.

Please check your folder. One created by Duplicati looks like

![image](https://forum.duplicati.com/uploads/default/original/2X/b/b1da583fa8532e0f6f61eabc995856758433ea7f.png)

What you should do is not manually make folder, but use `Test connection` to let Duplicati do it.

If you prefer to use an option that Google wants to kill (as insecure) get an AuthID using this site:

[https://duplicati-oauth-handler.appspot.com/](https://duplicati-oauth-handler.appspot.com/)

![image](https://forum.duplicati.com/uploads/default/original/2X/9/90e59aa106e54d4a35c9442737ff62e8f7e42808.png)

Google’s planned cutoff (which they have not done yet, and I have no idea whether they ever will):

[Enhancing security controls for Google Drive third-party apps](https://cloud.google.com/blog/products/identity-security/enhancing-security-controls-for-google-drive-third-party-apps)

> [@lmey](#):
>
> pre-existing folder on Drive

sounds like Duplicati didn’t make it, but you can verify. Below is the Duplicacy (not Duplicati) issue:

[more restrictive scope for Google Drive #555](https://github.com/gilbertchen/duplicacy/issues/555) (asks for drive.file scope, like Duplicati is already on)

> <https://github.com/duplicati/oauth-handler/blob/c7da1816700ca96c8553d117ebd899f43377ab83/settings.py#L232-L251>

EDIT:

I’m still not certain what scope Duplicacy uses, but I’m pretty sure it’s not (or was not?) `drive.file`.

[Reducing Google Drive scope: a simple proposal](https://forum.duplicacy.com/t/reducing-google-drive-scope-a-simple-proposal/3625)

[Google Drive, drive.appdata scope, service account impersonate](https://forum.duplicacy.com/t/google-drive-drive-appdata-scope-service-account-impersonate/4462)

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 11:29am UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/5 "2022-05-31T11:29:45Z")

</div>

I see so this works for Duplicacy because of the full access scope ? Or a more permissive one anyway. Well in the meantime I can confirm Duplicati does not create the folder so I don’t know what to to do. Giving it full access does not seem like a good solution to me given what you said.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 1:22pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/6 "2022-05-31T13:22:44Z")

</div>

Testing to personal (not Business, Education, etc.) plan. What’s yours?  
Testing Path on server to see what I can create with nothing there now.

foldercreate Test connection says “The folder foldercreate does not exist. Create it now?” Yes does.  
foldercreate Backup creates the folder and puts the backup in it.

foldercreate/subfolder Test connection says “The folder foldercreate/subfolder does not exist. Create it now?” Yes does.  
foldercreate/subfolder Backup creates the folder and puts the backup in it.

So this is one of the storage types that can automatically create for me. I think some require help.  
Implication from the above is that if it couldn’t see your pre-created folder, it should create its own.  
Google Drive has the unusual ability to have multiple folders or files that all share the same name.  
But apparently something went wrong, so a close look at what was done (and resulted) is needed.

> [@lmey](#):
>
> Duplicati does not create the folder

What does it do, e.g. from `Test connection`? Does it message like I said? How do you respond?

If you are in a complex plan involving sharing, permissions may be complex. I only have personal.  
Presumably you have storage space of your own. You could just try a test exactly like I performed.  
Duplicati’s job editor will insist that you give it at least one file. I gave it a short text file for this test.

More technical is to test Drive with [Duplicati.CommandLine.BackendTool.exe](https://duplicati.readthedocs.io/en/latest/07-other-command-line-utilities/#duplicaticommandlinebackendtoolexe) to see what it will do.  
You can get a storage URL from [Export As Command-line](https://duplicati.readthedocs.io/en/latest/03-using-the-graphical-user-interface/#exporting-a-backup-job-configuration).

Here’s a look in the top-level folder I made. If I delete URL `foldercreate`, I see Duplicati’s folders.  
What I don’t see (because this is a limited view) are non-Duplicati items of personal “home” folder.

```plaintext
Duplicati.CommandLine.BackendTool.exe list "googledrive://foldercreate?authid=REDACTED"
Name Dir/File LastChange Size
subfolder Dir 1/1/0001 12:00:00 AM

```

Doing `list` should be very safe, but there are other operations possible that actually change data.

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 1:42pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/7 "2022-05-31T13:42:45Z")

</div>

> Testing to personal (not Business, Education, etc.) plan. What’s yours?

I have a personal Drive of 15Go, nothing fancy, all default stuff. There’s already some data in it but that shouldn’t matter.

> What does it do, e.g. from `Test connection`? Does it message like I said? How do you respond?

That’s in the first post. I get "Failed to connect: Internal Server Error " in the popup, and the actual HTTP response is code 500 with the body from my first post. It only works if I leave the server path empty, but it creates the backup at the root of the drive, which isn’t what I want.

> You could just try a test exactly like I performed.

I’m using the linuxserver/duplicati Docker image and I can’t find a similar command line tool in the container.

EDIT: I just found this [Failed to connect: | Google Drive · Issue #38 · linuxserver/docker-duplicati · GitHub](https://github.com/linuxserver/docker-duplicati/issues/38) but it does not help a lot

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 2:19pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/8 "2022-05-31T14:19:54Z")

</div>

> [@lmey](#):
>
> That’s in the first post. I get "Failed to connect: Internal Server Error " in the popup, and the actual HTTP response is code 500 with the body from my first post.

This combination sounds strange, but I don’t get to this level much (no nice logging, unfortunately).  
We’re also unfortunately back to the mystery of the 500…

> [@lmey](#):
>
> I can’t find a similar command line tool in the container.

Unless they removed it, it’s with the detailed Duplicati installation (no wrapper script like in /usr/bin).  
Possibly /usr/lib/duplicati is their installation directory. If you find it and it won’t start, try saying `mono`  
before `.exe` file path. Some Linux systems need that hint.

> [@lmey](#):
>
> It only works if I leave the server path empty

Meaning even a simple one-word-no-slash `Path on server` fails I assume. If so, that seems weird, especially since file uploads must be working if you can put them where you don’t want them in root.

If you can find the tool, `createfolder` after a URL edit seems to be the method to create the folder.  
I’m pretty sure `Test connection` here is a `list`, so that’s the first test to try to see if it gets the 500.  
I just tried a `list`, changing `createfolder` to `foldermissing`, and at least the tool quietly said that

> Command failed: The requested folder does not exist

> [@lmey](#):
>
> it does not help a lot

It might tempt you to try a test with a full access token, but that could possibly go after the other testing.  
I’d note that lots of storage services don’t even offer a restricted scope to keep apps in their own files…

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 3:35pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/9 "2022-05-31T15:35:31Z")

</div>

Oooh actually it’s only the “Test Connection” that does not work ! It does create the folder (even subfolder) fine when the job is started. Since Test Connection does not create the folders I guess my error make sense. Maybe Duplicati could add a warning or something ?

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 3:56pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/10 "2022-05-31T15:56:47Z")

</div>

> [@lmey](#):
>
> Maybe Duplicati could add a warning or something ?

What exactly happens when you press “Test connection”? If I try that with my Internet off, it pops Error:

> Failed to connect: Failed to authorize using the OAuth service: The remote name could not be resolved: ‘[duplicati-oauth-handler.appspot.com](http://duplicati-oauth-handler.appspot.com)’. If the problem persists, try generating a new authid token from: [Duplicati OAuth Handler](https://duplicati-oauth-handler.appspot.com?type=googledrive)

I think there’s already some level of error reporting now. I know of no way to force Google to error 500.

I’m still pretty sure this `Test connection` (unlike a few fancy ones) is a `list`. Ever find BackendTool?

> <https://github.com/duplicati/duplicati/blob/93a4e2cb6e60c85357cfad9f1288c9833919a054/Duplicati/Library/Backend/GoogleServices/GoogleDrive.cs#L291-L294>

> <https://github.com/duplicati/duplicati/blob/93a4e2cb6e60c85357cfad9f1288c9833919a054/Duplicati/Library/Interface/BackendExtensions.cs#L14-L26>

> [@lmey](#):
>
> It does create the folder (even subfolder) fine when the job is started.

While I’d like to understand the `Test connection` issue, bottom line might be – does this fix backup?

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 5:22pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/11 "2022-05-31T17:22:29Z")

</div>

> [@ts678](#):
>
> What exactly happens when you press “Test connection”? If I try that with my Internet off, it pops Error:

When I put a path, exactly what I said before: “Failed to connect: Internal Server Error”.

> I’m still pretty sure this `Test connection` (unlike a few fancy ones) is a `list`. Ever find BackendTool?

Found it !

```plaintext
abc@fda341668241:/app/duplicati$ mono Duplicati.CommandLine.BackendTool.exe list "googledrive://foldercreate?authid=REDACTED"
Name Dir/File LastChange Size
Command failed: The requested folder does not exist

```

Note that even if I create `/foldercreate` in my drive. I still get the same error. However this works :

```plaintext
abc@fda341668241:/app/duplicati$ mono Duplicati.CommandLine.BackendTool.exe createfolder "googledrive://foldercreate?authid=REDACTED"

```

It’s just that Test Connection shouldn’t take into account the server path field IMO

> [@ts678](#):
>
> While I’d like to understand the `Test connection` issue, bottom line might be – does this fix backup?

Actually backup probably always worked, I was just trying with Test Connection the whole time while setting up the actual backup job. Thinking it didn’t work I never bothered trying just running it. This is just an UX issue.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 7:09pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/12 "2022-05-31T19:09:15Z")

</div>

> [@lmey](#):
>
> Note that even if I create `/foldercreate` in my drive.

If you do that through the Google web UI, the result is expected. You can also check file info:

![image](https://forum.duplicati.com/uploads/default/original/2X/7/7dca3588556bbb4f16a30d7de7e2570091b4cc1d.png)

for any folder that you click to see Google Drive’s data on who (you or Duplicati) created that.

> [@lmey](#):
>
> It’s just that Test Connection shouldn’t take into account the server path field IMO

This proposal would defeat the whole idea of testing whether destination folder already exists.  
There are two parts to it, it appears. One is whether a connection at all to server can be done.  
The other part is whether that folder exists already. If not, you are asked if you wish to make it.  
I think there’s at least one storage type (I forget which) which relies on such manual creations.  
The two aspects seem (to me) to fit together, and testing exactly the desired path seems best.  
I’m almost certain that the folder test infers that the connection works, without specific testing.

> [@lmey](#):
>
> This is just an UX issue.

Not solved yet. The error 500 seems wrong, but you now have some folders Duplicati created.  
What happens if you `Test connection` on the `foldercreate` you made using BackendTool?  
You can also see if you can `list` it. There “should” be no subfolder in it, unless you made one.  
There “should” also be no errors coming back. If this works, then you can test with a subfolder.

The goal with all this is to see if things work more as expected when you’re not right at the root.  
Unfortunately I can’t easily test a root with no Duplicati-created things in it, if that state matters.

If you have a Windows system, comparison tests between that and Docker may be interesting.  
Windows can also do unencrypted network tracing so you can catch some actual server traffic.  
This gets rather technical. I’d give it a try, except I can’t reproduce the issue that you’re having.  
It might provide a logical explanation for why Google sent error 500. That’s still quite a mystery.

EDIT:

Maybe you have a more advanced network troubleshooting ability that works on your Docker?

> [@lmey](#):
>
> but in the HTTP response I get
> 
> ```plaintext
> {
> "Error": "missing-folder"
> }
> 
> ```

Where did the response show up, and if you can get the response, can you get the request as well?  
Be careful about posting things. We wouldn’t want any authentication or credential information seen.

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 7:53pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/13 "2022-05-31T19:53:03Z")

</div>

> [@ts678](#):
>
> This proposal would defeat the whole idea of testing whether destination folder already exists.  
> There are two parts to it, it appears. One is whether a connection at all to server can be done.  
> The other part is whether that folder exists already. If not, you are asked if you wish to make it.  
> I think there’s at least one storage type (I forget which) which relies on such manual creations.  
> The two aspects seem (to me) to fit together, and testing exactly the desired path seems best.  
> I’m almost certain that the folder test infers that the connection works, without specific testing.

IMO from a user point of view, Test Connection, as its name implies, should test the connection, not try to create the folders. But yeah the ideal scenario is what you propose, since it involves asking the user about folder creation.

> [@ts678](#):
>
> Not solved yet. The error 500 seems wrong, but you now have some folders Duplicati created.  
> What happens if you `Test connection` on the `foldercreate` you made using BackendTool?  
> You can also see if you can `list` it. There “should” be no subfolder in it, unless you made one.  
> There “should” also be no errors coming back. If this works, then you can test with a subfolder.

Test Connection works with a path (say `testfolder`) if I use BackendTool createfolder prior yes. Listing works too. If I add a subfolder like `testfolder/sub`, I get the 500.

> [@ts678](#):
>
> Where did the response show up, and if you can get the response, can you get the request as well?

In my browser network tab. And sure:

```plaintext
POST /api/v1/remoteoperation/test HTTP/2
Host: duplicati.<REDACTED>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Accept: application/json, text/plain, */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/json;charset=utf-8
X-XSRF-Token: <REDACTED>
Content-Length: 88
Origin: https://duplicati.<REDACTED>
DNT: 1
Connection: keep-alive
Referer: https://duplicati.<REDACTED>/ngax/index.html
Cookie: default-theme=ngax; AUTHP_SESSION_ID=<REDACTED>; access_token=<REDACTED>; xsrf-token=<REDACTED>
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
TE: trailers
googledrive://notcreatedfolder?authid=<REDACTED>

```

```plaintext
HTTP/2 500 Internal Server Error
cache-control: no-cache, no-store, must-revalidate, max-age=0
content-language: fr
content-type: application/json
date: Tue, 31 May 2022 19:23:51 GMT
server: Caddy
server: Tiny WebServer
set-cookie: xsrf-token=<REDACTED>; expires=Tue, 31 May 2022 19:33:50 GMT;path=/;
content-length: 34
X-Firefox-Spdy: h2
{
  "Error": "missing-folder"
}

```

Actually I know what is happening here… It ends up in this line [duplicati/Duplicati/Server/WebServer/RESTMethods/RemoteOperation.cs at beaf03562fdcf4425e962085bdf7175d6a465f49 · duplicati/duplicati · GitHub](https://github.com/duplicati/duplicati/blob/beaf03562fdcf4425e962085bdf7175d6a465f49/Duplicati/Server/WebServer/RESTMethods/RemoteOperation.cs#L93) ! My guess is it tries to list files in a non existent folder (because Test Connection does not create them prior). For some reason the call fails and Duplicati is saying yeah folder is missing. Error response code is a bit dramatic though for sure 😄

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 8:59pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/14 "2022-05-31T20:59:58Z")

</div>

> [@lmey](#):
>
> IMO from a user point of view, Test Connection, as its name implies, should test the connection, not try to create the folders.

It does both. Because you seem technical (care to volunteer some? Duplicati benefits from volunteers):

[https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Interface/IBackend.cs](https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Interface/IBackend.cs)  
shows what a backend is supposed to be able to do, which is actually a bit more than the remote itself:

[Developer documentation](https://github.com/duplicati/duplicati/wiki/Developer-documentation)

> The backends encapsulate the actual communication with a remote host with a simple abstraction, namely that the backend can perform 4 operations: GET, PUT, LIST, DELETE. All operations performed by Duplicati relies on only these operations, enabling almost any storage to be implemented as a destination.

As mentioned earlier, testing is usually the `list` operation. At least one backend includes a [fancy test](https://github.com/duplicati/duplicati/blob/93a4e2cb6e60c85357cfad9f1288c9833919a054/Duplicati/Library/Backend/AlternativeFTP/AlternativeFTPBackend.cs#L449-L507).  
[Duplicati.CommandLine.BackendTester.exe](https://duplicati.readthedocs.io/en/latest/07-other-command-line-utilities/#duplicaticommandlinebackendtesterexe) is an even fancier (slower) one that one can run by hand.

Cloud destinations typically use some sort of an API, and there’s not really a separate connection test.  
Connection test with `list` from the API seems a good choice, testing connectivity, authentication, API.

What simpler could there be? At a TCP level, connecting means little, and sometimes IP isn’t known…  
If you’re arguing that the API `list` should target the root, maybe, but what UX would help with folder?

If you can lay out what UI flow you have in mind, that would help, but you might then have to code it.  
There are far too few develper-volunteers, and things that are merely non-ideal tend to not get done.

> [@lmey](#):
>
> In my browser network tab

I wonder if the original post did this too? We’d been trying to puzzle out why Google Drive sent 500.  
Here, we don’t know what it sent, but we know what Duplicati sent. How’s your JavaScript? Look at:

> <https://github.com/duplicati/duplicati/blob/93a4e2cb6e60c85357cfad9f1288c9833919a054/Duplicati/Server/webroot/ngax/scripts/directives/backupEditUri.js#L121-L135>

and although I don’t read JavaScript (my C# reading is a bit better), this is presumably what should have posed the question of what you want to do about the missing folder. To show it visually, I’m getting below:

![image](https://forum.duplicati.com/uploads/default/original/2X/4/41a1ab678f1635a3c7318ffbdd229a6313608362.png)

but you don’t? Do you get an error popup? When talking about UX, please say how the UI is working.  
Looking under the covers is fine for debugging though. I put Wireshark on this too to look a the traffic.  
That won’t work on the network going to Google, because it’s encrypted.

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 9:41pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/15 "2022-05-31T21:41:47Z")

</div>

> [@ts678](#):
>
> It does both. Because you seem technical (care to volunteer some? Duplicati benefits from volunteers):

Sorry C# isn’t my thing 😄

> [@ts678](#):
>
> I wonder if the original post did this too? We’d been trying to puzzle out why Google Drive sent 500.

I don’t think Google is doing it, Duplicati is. It’s in my previous link. See the method implementation where it sets HTTP 500 [duplicati/Duplicati/Server/WebServer/RESTMethods/RequestInfo.cs at beaf03562fdcf4425e962085bdf7175d6a465f49 · duplicati/duplicati · GitHub](https://github.com/duplicati/duplicati/blob/beaf03562fdcf4425e962085bdf7175d6a465f49/Duplicati/Server/WebServer/RESTMethods/RequestInfo.cs#L35)

> [@ts678](#):
>
> What simpler could there be? At a TCP level, connecting means little, and sometimes IP isn’t known…  
> If you’re arguing that the API `list` should target the root, maybe, but what UX would help with folder?
> 
> If you can lay out what UI flow you have in mind, that would help, but you might then have to code it.  
> There are far too few develper-volunteers, and things that are merely non-ideal tend to not get done.

The existing one is fine (asking the user if he wants to create it). You just have a bug in the JS you linked. I put a breakpoint in the JS debugger :  
 ![bug](https://forum.duplicati.com/uploads/default/original/2X/a/ad3403bf12de49de0f7a31bcc9b50dde4a3a80ab.jpeg)

See ? The `message` variable does not have the right value.

![data](https://forum.duplicati.com/uploads/default/original/2X/1/17ecfdc48b3965de404b84c3162f2aaf004eab49.png)

Code should be `var message = data.data.Error` instead. If I override the `message` variable in the JS console to “missing-folder” and resume the program, I do get the popup asking me to create the folders, and if I say yes it works as expected and the test is successful. By the way, that bug should totally fuck up the other `if`s as well 😬

You should totally be able to replicate the issue. Maybe you’re not testing with the same version ? As previously said, I’m on 2.0.6.3\_beta\_2021-06-17. Super recent.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 10:24pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/16 "2022-05-31T22:24:43Z")

</div>

> [@lmey](#):
>
> Sorry C# isn’t my thing

You cited some, so I was hoping… The good news is that you know JavaScript. More about that below.

> [@lmey](#):
>
> I don’t think Google is doing it, Duplicati is.

I agree, and I wrote “Here, we don’t know what it sent, but we know what Duplicati sent.”. Contrast to “I wonder if the original post did this too? We’d been trying to puzzle out why Google Drive sent 500.” last August from the original troubleshooting, and I’m not sure where OP looked. Few look at HTTP traffic…

> [@lmey](#):
>
> You should totally be able to replicate the issue.

Completely unable in 2.0.6.3\_beta\_2021-06-17. I was using Edge before. Now trying Firefox. It works.  
I’d have expected a bug like “Test connection” being as bad as it seems for you to be widely reported. Maybe different storage types work differently, that cuts it down, and maybe OP was seeing issue too?

Issues typically go to development by opening a GitHub [Issue](https://github.com/duplicati/duplicati/issues/), but if you know GitHub, consider a [Pull](https://github.com/duplicati/duplicati/pulls). JavaScript developers in either area may be even rarer than C# volunteers. Any other experts around?

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 10:41pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/17 "2022-05-31T22:41:45Z")

</div>

Is something (maybe a proxy) rewriting your messages from Duplicati? I have a direct connect, and get

```nohighlight
HTTP/1.1 500 missing-folder
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-Language: en-US
Date: Tue, 31 May 2022 20:13:44 GMT
Content-Length: 36
Content-Type: application/json
Server: Tiny WebServer
Connection: close
Set-Cookie: xsrf-token=REDACTED; expires=Tue, 31 May 2022 20:23:43 GMT;path=/; 

...{
  "Error": "missing-folder"
}

```

per Wireshark. Tiny WebServer is likely Duplicati [web server](https://github.com/duplicati/httpserver/blob/35eae1fe7df51668f3f09d538260804056dd9219/HttpServer/HttpResponse.cs#L353-L354). How did server: Caddy get in yours?

I don’t know JavaScript, but [Response.statusText](https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText) seems perfect for my response but not for yours.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [May 31, 2022, 10:58pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/18 "2022-05-31T22:58:26Z")

</div>

Possibly relevant to your response is the HTTP version. I’m getting 1.1 and you’re getting 2.

> [@lmey](#):
>
> `HTTP/2 500 Internal Server Error`

[Setting custom statustext in express response using default message?](https://stackoverflow.com/questions/66429867/setting-custom-statustext-in-express-response-using-default-message)  
says the “reason phrase” is gone in HTTP 2, so response body should be used. RFC says:

[8.1.2.4. Response Pseudo-Header Fields](https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.4)

> HTTP/2 does not define a way to carry the version or reason phrase  
> that is included in an HTTP/1.1 status line.

---

<div class="post-metadata">

**Author:** ![lmey](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lmey](https://forum.duplicati.com/u/lmey)\
**Post date:** [May 31, 2022, 11:03pm UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/19 "2022-05-31T23:03:06Z")

</div>

That’s exactly what I was writing 😄 Yes my Duplicati is sitting behind Caddy, which is a web server/reverse proxy which runs on HTTP2. My take on this is that Duplicati should rely on some kind of standard error codes in the response body, not on reason phrases. Which should not have been relied on in the first place, as pointed out by a Caddy maintainer [here](https://caddy.community/t/http-error-header-missing-text/14322/7) (exact same scenario).

The path of least resistance would be to make the change on the `message ` variable I suggested earlier I think. The change should be transparent… ? I can open an issue if you want.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [June 1, 2022, 12:51am UTC](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/20 "2022-06-01T00:51:30Z")

</div>

> [@lmey](#):
>
> Which should not have been relied on in the first place

That line was [rolled out](https://github.com/duplicati/duplicati/commit/736c17b61b3d92d8c97a39da98f6e4720a2207df#diff-6abd83f4fa0e62abc4579babbb462a31a01deb1f759c9a318016dda0a5ae32f8) in 2015, possibly thinking of the looser language of the 1999 standard:  
[6.1.1 Status Code and Reason Phrase](https://datatracker.ietf.org/doc/html/rfc2616#section-6.1.1) does sound like the intent was just a human-read note.  
Maybe whoever wrote the code didn’t keep up with the firmer rules from the 2014 RFC update.  
Unless someone makes a point of doing this, I can easily see a lot of older information around.

So I see Caddy Dec. 21 was saying they had no option (blaming the Go lib) but rewrite reason.  
The person asking said it was a deal-breaker with Caddy and went looking for an alternative…

> [@lmey](#):
>
> The path of least resistance would be to make the change on the `message ` variable I suggested earlier

I wonder how many other places need a change? At least it’s finite. A text search says around 16.  
That’s counting ones like the one here, and there are a couple more `statusText` usages around.  
If we’re lucky, there will be a standard HTTP style where the message we need is in the body too.

I’m just searching \*.js with Notepad++, but the GitHub search box also looks quite good at finding.  
[https://github.com/Pectojin/duplicati-client](https://github.com/Pectojin/duplicati-client) is a command line client in Python running the web API.  
It’s by a former Duplicati developer who reverse-engineered it. Maybe you can check how it works.

> [@lmey](#):
>
> I can open an issue if you want.

You could, but it might not get done due to lack of help. A pull request might have a better chance.  
There’s also some automated testing (which may or may not do GUI/API work) during submission.

Another way to test these things might be to start modifying/testing JavaScript installed on-system.  
I found some JavaScript files in my installation folder under `webroot\ngax\scripts\directives`

Well, we made some progress de-mystifying a couple of things. Thanks for help. More may help…

[Next page](https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891.md?page=2)
