# Links in Text files will open 2x

**URL:** <https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729>\
**Category:** ℹ️ Support\
**Created:** [November 12, 2022, 7:35pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729 "2022-11-12T19:35:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [November 12, 2022, 7:35pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/1 "2022-11-12T19:35:12Z")

</div>

When i create text file with a link, its will open 2x. In a new tab and also without.

[http://eb12.de/nextcloud.webm](http://eb12.de/nextcloud.webm)

It is a bug?

---

<div class="post-metadata">

**Author:** ![Daphne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/daphne/32/47373_2.png) [@Daphne](https://help.nextcloud.com/u/Daphne)\
**Post date:** [November 12, 2022, 7:53pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/2 "2022-11-12T19:53:52Z")

</div>

I see this is a share link, do you also have the issue if you are editing in the original file while logged in in Nextcloud?

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [November 12, 2022, 7:59pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/3 "2022-11-12T19:59:05Z")

</div>

Hi @JoHn12,  
[You are missing the required support template. Please fill this form out](https://help.nextcloud.com/t/support-template-please-use-this-when-you-request-support/137402) and edit into your post.

This will give us the technical info and logs needed to help you! Thanks.

---

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [November 16, 2022, 12:09pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/4 "2022-11-16T12:09:55Z")

</div>

Nextcloud version _(eg, 20.0.5)_: `24.0.7`  
Operating system and version _(eg, Ubuntu 20.04)_: `Debian 10.13`  
Apache or nginx version _(eg, Apache 2.4.25)_: `2.4.38`  
PHP version _(eg, 7.4)_: `7.4.33`

The issue you are facing: Markdown Text Editor http Link

Is this the first time you’ve seen this error? No

Steps to replicate it: Create text file,add link, share the file, click the URL in the text file

The output of your Nextcloud log in **Admin \> Logging** :

```auto
Level	App	Message Time
Info	updater	\OC\Updater::resetLogLevel: Reset log level to Warning(2)	
2022-11-16T11:43:22+0100
Info	updater	\OC\Updater::maintenanceDisabled: Turned off maintenance mode	
2022-11-16T11:43:22+0100
Info	updater	\OC\Updater::updateEnd: Update successful	
2022-11-16T11:43:22+0100
Info	updater	\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check	
2022-11-16T11:43:22+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "tasks.page.index" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "photos.page.index" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "files.view.index" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "files.view.index" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "deck.page.index" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "dashboard.dashboard.index" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "activity.Activities.showList" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "ocs.password_policy.API.validate" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "ocs.password_policy.API.generate" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "cloud_federation_api.RequestHandler.addShare" as such route does not exist.	
2022-11-16T11:43:17+0100
Info	updater	\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Add token cleanup job	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Add background job to set the lookup server share state for users	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Repair DAV shares	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Queue a one-time job to check for user uploaded certificates	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Add job to cleanup the bruteforce entries	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Remove old dashboard app config data	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Check encryption key format	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Keep legacy encryption enabled	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Reset generated avatar flag	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Clear access cache of projects	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::info: Repair info: No need to remove link shares.	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::info: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Remove potentially over exposing share links	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Add background job to cleanup login flow v2 tokens	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Cleanup invalid photocache files for carddav	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Queue a one-time job to cleanup old backups of the updater	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Add preview background cleanup job	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::step: Repair step: Clear every generated avatar on major updates	
2022-11-16T11:43:17+0100
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used	
2022-11-16T11:43:17+0100
Info	updater	\OC\Repair::info: Repair info: JS cache cleared

```

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

```auto
<?php
$CONFIG = array (
  'passwordsalt' => '+++++++',
  'secret' => '++++++',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'nextcloud.+.de',
  ),
  'datadirectory' => '/var/www/vhosts/+.de/.nextcloud/data/+++++',
  'dbtype' => 'mysql',
  'version' => '24.0.7.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => '++++++',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '+++++',
  'dbpassword' => '+++++',
  'installed' => true,
  'instanceid' => '+++++',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'mindmap_app',
    1 => 'occweb',
    2 => 'files_trackdownloads',
  ),
  'mail_domain' => '+++++',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'info',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => '+++++',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '587',
  'mail_smtpname' => '++++',
  'mail_smtppassword' => '+++++',
  'mail_smtpsecure' => 'tls',
  'memcache.distributed' => '\\OC\\Memcache\\APCu',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'default_phone_region' => 'GB',
  'default_locale' => 'en_US',
  'updater.secret' => '++++++',
);

```

The output of your Apache/nginx/system log in `/var/log/ ____ `:

```auto
(32)Broken pipe: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
20788#0: *31382 upstream prematurely closed connection while sending to client
(104)Connection reset by peer: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
(70007)The timeout specified has expired: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

```

PASTE HERE

```auto
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"Y+","level":2,"time":"2021-09-27T06:33:47+00:00","remoteAddr":"+","user":"--","app":"OC\\Log\\Rotate","method":"GET","url":"/cron.php","message":"Log file \"/var/www/vhosts/+.de/.nextcloud/data/+/nextcloud.log\" was over 104857600 bytes, moved to \"/var/www/vhosts/+.de/.nextcloud/data/+/nextcloud.log.1\"","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0","version":"21.0.4.1"}
{"reqId":"+","level":3,"time":"2021-09-27T06:33:49+00:00","remoteAddr":"+","user":"+","app":"PHP","method":"GET","url":"/index.php/core/preview?fileId=47196&x=32&y=32","message":{"Exception":"Error","Message":"file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/+.de/:/tmp/) at /var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php#135","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php","line":135,"function":"file_exists"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php","line":259,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php","line":294,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0","version":"21.0.4.1"}
{"reqId":"+","level":3,"time":"2021-09-27T06:33:50+00:00","remoteAddr":"+","user":"adminarftcyhcqis","app":"PHP","method":"GET","url":"/index.php/core/preview?fileId=14501&x=32&y=32","message":{"Exception":"Error","Message":"file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/+.de/:/tmp/) at /var/www/vhosts/++de/nextcloud.+.de/lib/private/Route/Router.php#135","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php","line":135,"function":"file_exists"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php","line":259,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Route/Router.php","line":294,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/+.de/nextcloud.+.de/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/vhosts/+.de/nextcloud.+.de/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0","version":"21.0.4.1"}

```

---

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [November 22, 2022, 10:44pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/5 "2022-11-22T22:44:34Z")

</div>

No. Only in shared link.

---

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [November 26, 2022, 2:28pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/6 "2022-11-26T14:28:05Z")

</div>

now i get more issues in latest version 25.0.1.

---

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [December 4, 2022, 4:09pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/7 "2022-12-04T16:09:05Z")

</div>

I am not more able to copy shared link.

---

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [December 4, 2022, 4:10pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/8 "2022-12-04T16:10:37Z")

</div>

The issues comes because i have these issues?

here are some warnings regarding your setup.

- The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
  - Missing index “direct\_edit\_timestamp” in table “oc\_direct\_edit”.
  - Missing index “preferences\_app\_key” in table “oc\_preferences”.
  - Missing index “mounts\_class\_index” in table “oc\_mounts”.

- Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running “occ db:convert-filecache-bigint” those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read [the documentation page about this ↗](https://docs.nextcloud.com/server/25/go.php?to=admin-bigint-conversion).
  - file\_metadata.id

Please double check the [installation guides ↗](https://docs.nextcloud.com/server/25/go.php?to=admin-install), and check for any errors or warnings in the [log](https://nextcloud.secoshare.de/index.php/settings/admin/logging).

Check the security of your Nextcloud over [our security scan ↗](https://scan.nextcloud.com).

Or its because failed upgrade?

---

<div class="post-metadata">

**Author:** ![JoHn12](https://help.nextcloud.com/letter_avatar/john12/32/5_5575768a8748004e209b776fc1b2916d.png) [@JoHn12](https://help.nextcloud.com/u/JoHn12)\
**Post date:** [December 4, 2022, 4:14pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/9 "2022-12-04T16:14:53Z")

</div>

i have installed new on second domain and i get same errors. The bug exist in the core i think.

Tested with Firefox and Opera on Linux. Latest version.

---

<div class="post-metadata">

**Author:** ![max-nextcloud](https://help.nextcloud.com/user_avatar/help.nextcloud.com/max-nextcloud/32/76206_2.png) [@max-nextcloud](https://help.nextcloud.com/u/max-nextcloud)\
**Post date:** [December 15, 2022, 5:24pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/10 "2022-12-15T17:24:19Z")

</div>

Hi @JoHn12

I’m working on text. I was able to reproduce the issue you are seeing with opening links twice. I don’t think it has anything to do with your setup. It’s probably a problem in the javascript we ship with text.

Do you happen to have a [github.com](http://github.com) account? Could you file this as a bug on our issue tracker?

Thanks for reporting this. I’m looking into issues with links right now anyway. So I hope i will get to fix this as well.

---

<div class="post-metadata">

**Author:** ![mejo](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mejo/32/9592_2.png) [@mejo](https://help.nextcloud.com/u/mejo)\
**Post date:** [March 21, 2023, 11:36am UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/11 "2023-03-21T11:36:28Z")

</div>

Just wanted to mention that the issue with links opening two times got solved in the meantime. In latest Nextcloud 25 for sure, and I think it should also be solved in latest Nextcloud 24 release.

---

<div class="post-metadata">

**Author:** ![mig5](https://help.nextcloud.com/letter_avatar/mig5/32/5_5575768a8748004e209b776fc1b2916d.png) [@mig5](https://help.nextcloud.com/u/mig5)\
**Post date:** [June 26, 2023, 10:13pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/12 "2023-06-26T22:13:05Z")

</div>

Definitely _not_ fixed in Nextcloud 25.0.8. It occurs if the user doesn’t have ‘edit’ permission for the file (if they do, it is not reproducible). I just filed [[Bug]: clicking a hyperlink in a document opens in both the current tab and a new tab for users who can't edit the file · Issue #39021 · nextcloud/server · GitHub](https://github.com/nextcloud/server/issues/39021)

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 2:28pm UTC](https://help.nextcloud.com/t/links-in-text-files-will-open-2x/149729/13 "2024-12-14T14:28:34Z")

</div>


