Getting internal Server Error with status code 500, on hitting duplicate file api inside the pantaris.io

Hi There,

Issue: After pushing duplicate file api code to pantaris sandbox, getting Internal server Error as shown in screenshot.

Details:

Working Scenario:

  • We are using duplicate file API to create same file in different directory.

  • With swagger, postman and in localhost, the Api is working fine.

Not Working Scenario:

  • But when we pushed this code in pantaris , getting internal server error.

So please anyone help me to resolve this issue. Thank You!!

Error:

Swagger hosted in Pantaris:

Swagger in Localhost:

Hello Roopabasavaraj,

it seems like the error is originating from your application. The endpoints and swagger screenshots show your API. Without the source code and more detailed errors and context, i cannot say much (please no screenshots, just copy paste it into a codeblock).

Kind Regards, Hans

Hi @hans.ferchland

  • From our application the error is not coming, after hitting to pantaris.io Api we are getting internal server error.
  • The endpoints names are according to my application; we are using some structure format to display it in swagger but for inside functionality we are calling pantaris duplicate files Api to perform action.

Below you can see the code:

 const duplicateFileToDirectory = async (request, response, next) => {
  try {
    const { directoryId, fileId } = request.params;
    const fileDetail = await this.calponia.api(). v2.post('/files/duplicate', {
      "directoryId": directoryId,
      "files": [
        {
          "id": fileId
        }
      ]
    });
         return response.json(fileDetail).
   } catch (error) {
    console.log({ message: error.message });
  }
  • After passing directoryId and file Id to the code, it’s hitting the Api and directly going inside catch block instead of returning response and giving internal server error with 500 status code as shown in first screenshot.

Note:

  • When we tried to hit this api outside pantaris (like Postman or localhost) - it’s working fine.

*When it is hosted in pantaris platform- it’s throwing internal server error.

Hi @hans.ferchland ,
Any updates on above query ?

I checked the error and it is missing the token when doing the request, so it is missing somehow. I also see you are using the SDK: unfortunately it is kinda unmaintained at the moment.

The difference you have can result from the SDK setting itself up in different environments (locally vs running on PANTARIS) and thus missing the token. See the docs on Initialization for more: Documentation | PANTARIS

To eliminate the SDK here, use the API directly with a client of your choice. e.g. axios or node-fetch

Also notable, the section on authorization as application (hosted on Pantaris): Documentation | PANTARIS . If you use the API via backend, you do not need to provide a token, the application has one automatically.

Sorry for any inconveniences.

1 Like