Gitlab API - import project

Currently trying to import an exported gitlab project into another gitlab instance. I´m reciving an Internal Server error with no further information.

From what I can read from the docs i feel that i do the request correctly..

After requesting the file (Export function/ I´m writing it to the filesystem):

groupExport: async (gitlabInstance, groupId) => {
        if (!groupId || groupId === '') {
            throw new Error('groupId is needed');

        let API_RESOURCE = `groups/${groupId}/export`;

        try {
            let { body } = await;

            let fileBuffer = await utilsHttp
                .get(API_RESOURCE + '/download')

            return fileBuffer;
        } catch (error) {
            return null;

This is how I write the file to the filesystem:

async function writeBufferToFile(buffer, filePath) {
    filePath = filePath || '../tmp/exported-group.tar.gz';
    const fileOutPath = path.join(__dirname, filePath);

    try {
        await fsPromise.writeFile(fileOutPath, buffer);
        console.log('WROTE FILE');
        return true;
    } catch (error) {
        throw new Error(error);

And then trying to import in to gitlab:

groupImport: async (gitlabInstance, filePath) => {
        const API_RESOURCE = `groups/import`;
        const form = new FormData();

        form.append('name', 'test-import');
        form.append('path', 'test-import');
        form.append('file', `${fs.createReadStream(filePath)}`);

        try {
            gitlabInstance.defaults.options = gitlabInstance.mergeOptions(
                    headers: { 'Content-Type': 'multipart/form-data' },
            let res = await, {
                body: form,
            return true;
        } catch (error) {
            return null;

Result: HTTPError: Response code 500 (Internal Server Error)

The docs only provide an example that is using CURL. Currently don't know what is wrong with my request. Find the docs here

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum