n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
49.62k stars 8.03k forks source link

Nextcloud Integration Pulling HTML instead of files through WebDAV #11391

Open pypeaday opened 1 month ago

pypeaday commented 1 month ago

Bug Description

I have n8n setup fresh with docker compose, I self-host nextcloud at https://mydomain.nextcloud.com. I started playing with n8n to just download a file from nextcloud but when I test the node the file it pulls isn't my target file, it's like it curled down the html

Here's the docker compose file for reproducing

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    container_name: n8n
    ports:
      - "5678:5678"
    volumes:
      - n8n_data:/home/node/.n8n
    restart: unless-stopped

volumes:
  n8n_data:

To Reproduce

  1. use docker compose to spin up n8n fresh
  2. add nextcloud credentials for a user on your instance (I'm happy to collaborate on my instance)
  3. add nextcloud node to download a file
  4. successfully test the node but the downloaded file is the html of a webpage, not the target file

Expected behavior

I would expect that if I wanted to download a Readme.md file at the root of my users folder that I would be able to open the downloaded file in a text editor and see the markdown content

Operating System

Fedora 40

n8n Version

1.64.2

Node.js Version

20.18.0

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 1 month ago

Hey @pypeaday,

We have created an internal ticket to look into this which we will be tracking as "GHC-343"

Joffcom commented 1 month ago

Hey @pypeaday,

I have just tried to reproduce this but for me using the latest 30.0.1 version of NextCloud it is working as expected. Can you make sure the URL for your Nextcloud credential includes /remote.php/webdav at the end so it knows to use Webdav.

image

pypeaday commented 1 month ago

I am on nextcloud 27 but since this is all over WebDAV I wouldn't expect any breaking changes... here's what I see on my end

image

But then if I click to show it in the output

<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en" data-locale="en" translate="no" >
    <head
 data-requesttoken="">
        <meta charset="utf-8">
        <title>
            Paynepride Cloud        </title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
                <meta name="apple-itunes-app" content="app-id=1125420102">
                <meta name="theme-color" content="#0CAB8E">
        <link rel="icon" href="/core/img/favicon.ico">
        <link rel="apple-touch-icon" href="/core/img/favicon-touch.png">
        <link rel="mask-icon" sizes="any" href="/core/img/favicon-mask.svg" color="#0CAB8E">
        <link rel="manifest" href="/core/img/manifest.json" crossorigin="use-credentials">
        <link rel="stylesheet" href="/core/css/server.css?v=10c07b1e-8">
<link rel="stylesheet" href="/apps/theming/css/default.css?v=34e90de1-8">
<link rel="stylesheet" href="/core/css/guest.css?v=10c07b1e-8">
        <script nonce="UXQrbURrL1VHUDdMdjd5M0NLZUxZQm9GMXNWakRjSTVxaEdqY3ZvZFo2Zz06R0xyUFJUZXlhYTJzanN2L1BjM3NMQzV0bjdNSE9LUjczMTdtSWJWN05Pdz0=" defer src="/dist/core-common.js?v=10c07b1e-8"></script>
<script nonce="UXQrbURrL1VHUDdMdjd5M0NLZUxZQm9GMXNWakRjSTVxaEdqY3ZvZFo2Zz06R0xyUFJUZXlhYTJzanN2L1BjM3NMQzV0bjdNSE9LUjczMTdtSWJWN05Pdz0=" defer src="/dist/core-main.js?v=10c07b1e-8"></script>
<script nonce="UXQrbURrL1VHUDdMdjd5M0NLZUxZQm9GMXNWakRjSTVxaEdqY3ZvZFo2Zz06R0xyUFJUZXlhYTJzanN2L1BjM3NMQzV0bjdNSE9LUjczMTdtSWJWN05Pdz0=" defer src="/dist/core-files_fileinfo.js?v=10c07b1e-8"></script>
<script nonce="UXQrbURrL1VHUDdMdjd5M0NLZUxZQm9GMXNWakRjSTVxaEdqY3ZvZFo2Zz06R0xyUFJUZXlhYTJzanN2L1BjM3NMQzV0bjdNSE9LUjczMTdtSWJWN05Pdz0=" defer src="/dist/core-files_client.js?v=10c07b1e-8"></script>
<script nonce="UXQrbURrL1VHUDdMdjd5M0NLZUxZQm9GMXNWakRjSTVxaEdqY3ZvZFo2Zz06R0xyUFJUZXlhYTJzanN2L1BjM3NMQzV0bjdNSE9LUjczMTdtSWJWN05Pdz0=" defer src="/js/core/merged-template-prepend.js?v=10c07b1e-8"></script>
<script nonce="UXQrbURrL1VHUDdMdjd5M0NLZUxZQm9GMXNWakRjSTVxaEdqY3ZvZFo2Zz06R0xyUFJUZXlhYTJzanN2L1BjM3NMQzV0bjdNSE9LUjczMTdtSWJWN05Pdz0=" defer src="/dist/files_sharing-main.js?v=10c07b1e-8"></script>
            </head>
    <body id="body-login">
        <noscript>
    <div id="nojavascript">
        <div>
            This application requires JavaScript for correct operation. Please <a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">enable JavaScript</a> and reload the page.        </div>
    </div>
</noscript>
                    <input type="hidden" id="initial-state-core-versionHash" value="IjEwYzA3YjFlIg==">
                    <input type="hidden" id="initial-state-comments-maxAutoCompleteResults" value="MTA=">
                <div class="wrapper">
            <div class="v-align">
                                    <header role="banner">
                        <div id="header">
                            <div class="logo"></div>
                        </div>
                    </header>
                                <main>
                    <h1 class="hidden-visually">
                        Paynepride Cloud                    </h1>
                    <div class="guest-box">
    <h2>Error</h2>
    <ul>
            <li>
            <p>App not installed: </p>
                    </li>
        </ul>
</div>
                </main>
            </div>
        </div>
        <footer role="contentinfo" class="guest-box">
            <p class="info">
                <a href="REDACTED URL" target="_blank" rel="noreferrer noopener" class="entity-name">Paynepride Cloud</a> – data de la Payne pride            </p>
        </footer>
    </body>
</html>

I do have javascript enabled in my browser

but I just noticed the App not installed error... any chance that's somehow related to notion? I use WebDAV via python for other nextcloud automations so I am not quite sure what to think about this

Joffcom commented 1 month ago

Hey @pypeaday,

It should be ok, Did you double check the URL in the credential? Just tested with a markdown file as well and that looks to be good.

image

As a quick test can you drop me an email to jon@n8n.io and I will share a test credential with you for the nextcloud instance I just setup and we can see if that works which would at least tell us if the issue is with your Nextcloud install or something else.

pypeaday commented 1 month ago

image ya my credentials look good.

I will send you an email

pypeaday commented 1 month ago

Ok well I didn't have the url right - but it's behaving exactly the same nevertheless

image

pypeaday commented 1 month ago

real quick fwiw

image

this URL didn't even connect for me but it's what is in docs here