| Summary: | 'NaN' token in JSON response | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] Pulp | Reporter: | Ivan Necas <inecas> | ||||
| Component: | user-experience | Assignee: | John Matthews <jmatthew> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 1.1.0 | CC: | jmatthew, skarmark | ||||
| Target Milestone: | --- | Keywords: | Triaged | ||||
| Target Release: | Sprint 34 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-05-25 14:15:44 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
Fix was to filter non integers from being passed into the ProgressTracker. Added 2 tests to ProgressTracker 1) for bad data of strings instead of ints 2) explicit test for NaN being passed in Fix was committed to Grinder's pulp_v1.1 branch. http://git.fedorahosted.org/git/?p=grinder.git;a=commitdiff;h=af3f6a384a25960259b7f02b353483f0ab0407c9 Will be in grinder 0.0.147 build: 1.1.3 verified [root@pulp-v1-1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/local-1/sync/ [{"scheduled_time": null, "exception": "Cannot read from directory /root/local-repo", "traceback": ["Traceback (most recent call last):\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/tasking/task.py\", line 418, in run\n result = self.callable(*self.args, **self.kwargs)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/api/repo_sync.py\", line 283, in _sync\n progress_callback, synchronizer, max_speed, threads)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/api/repo_sync.py\", line 368, in fetch_content\n progress_callback, max_speed, threads)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/api/synchronizers.py\", line 164, in sync\n max_speed=max_speed, threads=threads)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/api/synchronizers.py\", line 1265, in local\n self.init_progress_details(src_repo_dir, skip_dict)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/api/synchronizers.py\", line 891, in init_progress_details\n rpm_list = self.list_rpms(src_repo_dir)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/api/synchronizers.py\", line 860, in list_rpms\n pkglist = pulp.server.util.listdir(src_repo_dir)\n", " File \"/usr/lib/python2.7/site-packages/pulp/server/util.py\", line 366, in listdir\n raise Exception(\"Cannot read from directory %s\" % directory)\n", "Exception: Cannot read from directory /root/local-repo\n"], "job_id": null, "class_name": null, "start_time": "2012-04-23T15:01:03-04:00", "args": ["local-1"], "method_name": "_sync", "finish_time": "2012-04-23T15:01:03-04:00", "state": "error", "result": null, "scheduler": "immediate", "progress": null, "id": "ac2ca22b-8d76-11e1-9668-525400fbc951"}][root@pulp-v1-1-server ~]# [root@pulp-v1-1-server ~]# rpm -q grinder grinder-0.0.147-1.fc16.noarch [root@pulp-v1-1-server ~]# Pulp v1.1 Release |
Created attachment 566024 [details] Part of bad response from Pulp repo sync status Description of problem: In some circumstances Pulp returns NaN in some fields in JSON response. This causes problems parsing this JSON, since it's not valid token. Version-Release number of selected component (if applicable): 0.0.265-1 How reproducible: Sometimes Steps to Reproduce: 1. Synchronize remote repository 2. Perhaps some errors occur 3. Call api/repositories/repo_id/sync and parse it using a JSON parser Actual results: Sometimes error like this occurs (see attachment for a sample response): unexpected token at 'NaN' Expected results: Pulp always returns valid JSON string. Additional info: This error causes Katello not being able to handle responses from Pulp