# Code maintenance NEX-406 - "Unhandled error while creating file storage `nextcloud` – Name already taken" in integration_setup.sh script

Project: Stream Nextcloud app "OpenProject Integration"
Status: closed
URL: https://community.openproject.org/work_packages/NEX-406

## OPEN POINTS

_No work packages_

## Subtasks

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Designer |  |
| Developers |  |
| Requires doc change | No |
| Date |  |
| Priority | Medium |
| Target versions | Nextcloud Integration 2.7.1 |
| Module |  |
| Accessibility | No |
| List |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |
| Remaining work |  |

## Description

## **Description**:

While running the `integration_setup.sh` script to integrate OpenProject with Nextcloud, an error occurs when attempting to create the file storage. The script fails because OpenProject returns the error: `'Name has already been taken.'` indicating the storage name `'nextcloud'` already exists

## **Steps to reproduce:**

_NOTE: need to setup openproject and nextcloud with integration\_openproject apps_

Run following commands on path nextcloud/aps/integration\_openproject twice

```console
SETUP_PROJECT_FOLDER=true NEXTCLOUD_HOST=http://localhost/stable30 OPENPROJECT_HOST=http://localhost:3000 OP_ADMIN_USERNAME=apiadmin OP_ADMIN_PASSWORD=apiadmin NC_ADMIN_USERNAME=admin NC_ADMIN_PASSWORD=admin OPENPROJECT_STORAGE_NAME=nextcloud  bash integration_setup.sh
```

**Expected to have message:**

```console
Using default temp dir: ./temp
Creating file storage name "nextcloud" in OpenProject was successful.
Setting up OpenProject OAUTH configuration in Nextcloud was successful.
Setting up Nextcloud OAUTH configuration in OpenProject was successful.
Saving 'OpenProject' user application password to OpenProject was successful.
Setup of OpenProject and Nextcloud is complete.
```

**Actual Error occurs:**

```console
Using default temp dir: ./temp
Unhandled error while creating the file storage 'nextcloud'
OpenProject returned the following error: 'Name has already been taken.'
You could try deleting the file storage 'nextcloud' in OpenProject and run the script again.
```

<br>

**FOR QA:**

*   It is required to test the script on both OP version 14.2 and 14.5 version.
    

<br>
