gurock / testrail-api

TestRail API: Examples on how to use TestRail's API from various languages
Other
116 stars 86 forks source link

error when hit GET /get_plan using API v2 #39

Open indraaristya opened 1 year ago

indraaristya commented 1 year ago

500 status code error was occurred when I tried to hit /get_plan endpoint. Body response: Undefined property: stdClass::$dataset_id

{
    "error": "Undefined property: stdClass::$dataset_id"
}
shaheelroshankhan commented 1 year ago

I'm also hitting the same. Other APIs are working fine APIError: TestRail API returned HTTP 500 ({'error': 'Undefined property: stdClass::$dataset_id'})

bdfariello commented 1 year ago

We're seeing the same in our TestRail Cloud instance

TestRail version: 7.8.0 Default (1136) Built On: 1/25/2023 Database version: 20230105013501

We only started noticing it today

Moriarty16 commented 1 year ago

The same error while querying "api/v2/get_plan": "error": "Undefined property: stdClass::$dataset_id"

bdfariello commented 1 year ago

Something else I noticed today - we have some api/v2/get_plan/{plan_id} requests working successfully, while others do not

It seems like there was an attribute change in the back-end Test Plan objects, and so Plans created BEFORE we got this update trigger this bug, while Plans created AFTER we got this update do NOT trigger the bug.

sf0319 commented 1 year ago

Just wanted to pile to try and get more attention to this issue. I am seeing the exact same error for our instance as well since updating to TestRail version: 7.8.0 Default (1136).

indraaristya commented 1 year ago

Something else I noticed today - we have some api/v2/get_plan/{plan_id} requests working successfully, while others do not

It seems like there was an attribute change in the back-end Test Plan objects, and so Plans created BEFORE we got this update trigger this bug, while Plans created AFTER we got this update do NOT trigger the bug.

I've tried to update the test plan (only change the name) and save it then api/v2/get_plan/{plan_id} works perfectly again. Thanks!

indraaristya commented 1 year ago

[UPDATE]

You guys might need to update the test plan, try to change the name only or else and save it. The api/v2/get_plan/{plan_id} endpoint should be working fine after that. I've tried mine and it's works.

sf0319 commented 1 year ago

@indraaristya I wouldn't say that this issue is Resolved (or ready to be closed) just because there is a workaround. I would appreciate it if this bug was re-opened so that Gurock could address it and make a proper fix.

indraaristya commented 1 year ago

@indraaristya I wouldn't say that this issue is Resolved (or ready to be closed) just because there is a workaround. I would appreciate it if this bug was re-opened so that Gurock could address it and make a proper fix.

Sure, done.

Moriarty16 commented 1 year ago

4 days ago, request for plan A via this API fails, today the same request for plan A is successful. However, request for another plan B still fails with the same error today.

bdfariello commented 1 year ago

Gurock has confirmed in a Tech Support case that I filed that they have internally reproduced the bug, but have not provided a timeline for its resolution.

On Mon, Feb 13, 2023, 3:54 AM MadHatter @.***> wrote:

4 days ago, request for plan A via this API fails, today the same request for plan A is successful. However, request for another plan B still fails with the same error today.

— Reply to this email directly, view it on GitHub https://github.com/gurock/testrail-api/issues/39#issuecomment-1427562846, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDIDR7JJIWDOFS3SAWXCH3WXHZEHANCNFSM6AAAAAAUSDTYXU . You are receiving this because you commented.Message ID: @.***>

SarLecobee commented 1 year ago

Also started noticing this issue today.

patrick-cichon-gcx commented 1 year ago

We're also having the same issue since approximately a week

justinokoli commented 1 year ago

We are having this issues since a week now, all our operations are halted and we are considering next step with testrail

jbrekesJC commented 1 year ago

We have the same problem in my company since 2023-02-07, and I don't think that editing old plans would be so practical since we would have more than 2000 plans to change.

jnowo commented 1 year ago

I have the same problem since ~2023-02-20

Moriarty16 commented 1 year ago

The issue has been reported to TestRail 3 weeks ago, they confirmed it can be reproduced internally. But the issue has not been fixed so far...

Moriarty16 commented 1 year ago

It is said "There is no ETA for to bug but the fix will soon be released, most likely in the next TestRail update or the next two version upgrades".

So we may have to use the workaround for now until the new release fixes the issue.

jon-waite-tgcs commented 1 year ago

This is bad, it is blocking our reporting as an organization. Test Rail APIs are already overly verbose and nested, and now they do not work.

jnowo commented 1 year ago

For me it started working fine since yesterday. I don't get any errors with dataset_id now.

Moriarty16 commented 1 year ago

@jnowo As we tested earlier, we may fail to fetch data for some projects earlier, but then later we can successfully get the data for those projects. However, as I checked just now, I still get the same errors for some projects. The issue is not fixed yet.

shaheelroshankhan commented 1 year ago

It started working for me as well. But still I'm seeing the same error for some of the plan_id.

On Fri, Mar 10, 2023 at 2:05 PM MadHatter @.***> wrote:

@jnowo https://urldefense.com/v3/__https://github.com/jnowo__;!!MZ3Fw45to5uY!JFPC6mLa7wrYku7mH69W-LijWjMRInLUxpRMEwTKVC6jH7bcvMb9jWVDhNJDV4FkQRVkSE19GGGXtmTb9xKGdCHRI7mHALiVSFA$ As we tested earlier, we may fail to fetch data for some projects earlier, but then later we can successfully get the data for those projects. However, as I checked just now, I still get the same errors for some projects. The issue is not fixed yet.

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/gurock/testrail-api/issues/39*issuecomment-1463454137__;Iw!!MZ3Fw45to5uY!JFPC6mLa7wrYku7mH69W-LijWjMRInLUxpRMEwTKVC6jH7bcvMb9jWVDhNJDV4FkQRVkSE19GGGXtmTb9xKGdCHRI7mHpdcH22k$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A5WI4AD2CROHJRHKROUMEGDW3LRWXANCNFSM6AAAAAAUSDTYXU__;!!MZ3Fw45to5uY!JFPC6mLa7wrYku7mH69W-LijWjMRInLUxpRMEwTKVC6jH7bcvMb9jWVDhNJDV4FkQRVkSE19GGGXtmTb9xKGdCHRI7mHHLP9DXA$ . You are receiving this because you commented.Message ID: @.***>

Moriarty16 commented 1 year ago

Possible workaround:

  1. Get all the plans via get_plans/{project_id}
  2. Loop all the plans, use try-catch to get all the plans with the "Undefined property: stdClass::$dataset_id" issue
  3. For all the plans with the issue, change the plan names(maybe add _temp to the end of the plan name) via update_plan/{plan_id}, refer to update_plan
  4. Change these plans to their original names
  5. Query the data of these plans again, the issue should be fixed.

Note: This is just a possible workaround, as I haven't tested the API update_plan/{plan_id}, we only know if we manually update the plan name(add suffix and change back), then the http request will be fine.

Pls ignore the above comments, stupid I'm. Just realize, if there is an error in the request, we cannot get the plan name via API.

ziadtawfeek commented 1 year ago

I think this should be fixed now https://support.gurock.com/hc/en-us/articles/13703699589780-TestRail-7-8-0-Default-1140-

Moriarty16 commented 1 year ago

Actually we've heard the the issue should have been fixed within the above update, but the issue remains unfixed. And as I tested locally, the issue hasn't been fix at this moment. We've synced with TestRail again, waiting for their update.

Moriarty16 commented 1 year ago

We found the issue about 2 months ago, just tried locally, this issue can still be reproduced now. Unbelievable, is this bug so complex that it need several months to fix......

jbrekesJC commented 1 year ago

This bug is really complicating some of our processes. Still no news on the solution?

Moriarty16 commented 1 year ago

They sueggest us to create freash projects, manually create fresh TestRun, TestCases, without any import(To confirm some assumptions). The current plans we're testing are possibly corrupt, according to the recent conversations with them.

So the only solution for us is: Write a script to list all the current test plans in all the projects, then make requests to all the plans via API, record all the plans with this issue. Finally make the workaround to all these plans(rename) manually.

Moriarty16 commented 1 year ago

Now we're used a script to list all the plans with this issue, then run the workaround(rename, save, and rename back) on each of these plans one by one. Now we can access all the plans via API...