Hi,
We have self hosted Testiny server and trying import the cypress mochawesome json file to Testiny Automation through IntelliJ CLI, followed the same documentation Cypress | Testiny Documentation but we are receiving “Import error: The provided API key or URL is not valid: Internal Server Error“.
Created an API key which has below permission and using below command to import the cypress json to Testiny through CLI, can you please let us know what could be the issue in our command or API key?
setx TESTINY_API_KEY "****"
setx TESTINY_APP_URL “****“
npx @testiny/cli automation --project <MY_ID> --source "e2e" --cypress results/*.json
npx @testiny/cli automation --project <MY_ID> --source "e2e" --mochawesome results/*.json
here is the log in IntelliJ CLI.
o—o ----------------------------
| TESTINY IMPORTER 1.30.0
-o ----------------------------
**Import error: The provided API key or URL is not valid: Internal Server Error
Permission Linked to API KEY below:-
**
“perms”: [
“CAN_ACT_AS_AGENT”,
“CAN_COMMENT”,
“CAN_CREATE_TESTCASES”,
“CAN_CREATE_TESTPLANS”,
“CAN_DELETE_TESTCASES”,
“CAN_DELETE_TESTPLANS”,
“CAN_EXECUTE_TESTRUNS”,
“CAN_IMPORT_AUTOMATION_RESULTS”,
“CAN_MANAGE_MILESTONES”,
“CAN_MANAGE_TESTRUNS”,
“CAN_READ”
],
Hi and welcome to the Testiny forum!
Since this is Testiny Server, we cannot check the server logs ourselves to see what the internal error is about. You need to ask an administrator of your Testiny Server to check the logs if they contain further information.
As a first shot into the dark:
- make sure you use the same version of the Testiny CLI as the version your Testiny Server is running with (is this really v1.30.0?)
- you can see the version of your Testiny Server in the Settings->About page
If you’re really running Testiny Server v1.30.0, you might want to consider upgrading. The latest stable release is v1.34.1.
Best regards,
Alex
Hi, Corrected the Testiny CLI version, same as Testiny server v1.35.0, but still getting the same error.
We have set APP_URL and API_KEY in account environment variable, can we get to know which server the request is going when executing npx @testiny/cli automation?
Unfortunately, the CLI does not print out the URL of the server used.
But instead of the environment variable, you can try to use the --app flag.
Just pass in the server to use, e.g. npx @testiny/cli --app app.testiny.io
You can use a similar approach for the API key with the --apikey flag - or just omit it and the CLI will ask you for the API key.
If that does not help, looking at the server logs is your best option.
Best regards,
Alex