Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when adding nonexistent parameters to a profile is unhelpful #6229

Closed
rawlinp opened this issue Sep 21, 2021 · 1 comment · Fixed by #7241
Closed

Error message when adding nonexistent parameters to a profile is unhelpful #6229

rawlinp opened this issue Sep 21, 2021 · 1 comment · Fixed by #7241
Labels
improvement The functionality exists but it could be improved in some way. low difficulty the estimated level of effort to resolve this issue is low low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops

Comments

@rawlinp
Copy link
Contributor

rawlinp commented Sep 21, 2021

This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:

  • Traffic Ops

Current behavior:

If you try adding parameters to a profile and 1 or more of the parameters don't exist, you get an error message like the following:

parse error: validating: parameters with IDs [14 15 16 20 21 24 28 29 30 33 34 35 37 38 39 40 42 43 44 45 46 47 51 52 53 54 60 61 62 65 66 67 70 74 75 76 80 81 82 83 84 86 87 88 89 90 91 92 95 96 97 98 99 101 102 103 104 105 106 109 110 111 112 114 115 117 118 126 129 130 131 132 133 134 136 137 139 140 141 143 144 145 146 150 151 152 153 154 155 156 157 158 159 179 180 181 182 183 184 185 186 187 188 189 190 191 192 196 204 205 208 210 211 213 215 227 228 229 230 231 232 233 234 235 236 263 264 265 266 267 268 269 270 273 279 325 326 327 366 369 389 393 394 395 396 397 399 405 406 594 613 618 669 678 679 680 684 685 688 703 704 705 707 708 727 796 797 798 800 801 802 803 804 819 843 846 848 849 1002 1016 1020 1050 1994 2027 2028 2029 2030 2536 2539 2761 2921 2927 2937 2938 2939 2940 2952 2954 2968 3037 3045 3114 3226 3227 3228 3232 3260 3302 3439 3459 3466 3468 3483 3504 3506 3508 3510 3575 3670 3687 3689 3691 3692 3694 3695 3696 3697 3698 3699 3700 3701 3703 3705 3708 3709 3710 3711 3712 3713 3714 3715 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3734 3735 3736 3737 3738 3739 3740 3741 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3761 3762 3763 3764 3765 3766 3767 3768 3770 3771 3772 3773 3774 3775 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3789 3790 3791 3792 3793 3794 3795 3797 3798 3799 3802 3803 3804 3805 3807 3808 3809 3810 3811 3813 3815 3816 3817 3818 3820 3822 3823 3824 3825 3826 3827 3830 3831 3833 3834 3835 3836 3837 3838 3839 3841 3844 3845 3847 3848 3849 3851 3852 3853 3854 3855 3857 3858 3859 3860 3861 3862 3864 3865 3866 3867 3869 3870 3871 3872 3873 3874 3879 3881 3882 3884 3885 3942 3943 4440 4627 5250 5251 5252 5787 5795 5797 5838 5839 5843 6117 6118 6119 6120 6121 6122 6123 6124 6158 6231 6561 6849 7903 7913 9026 9027 9031 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9055 9067 9071 9072 9073 9074 9075 11051 13219 13249 13269 18296 18297 47145 58038 58041 58429 60387 60388 61380 66071 74128 75406 127942 134183 179270 310309 342802 398520 398526 428223 428224 428225 428226 428227 428228 428229 428230 492519 492520 492521 492522 497385 497386 499399 512264 536640 536644 542350 543648 543649 790008 791847 792188 807366 807368 807369 807370 807378 807385 807569 807601 807604 807606 807609 807621 807623 807669 807670] don't all exist

In this scenario, the user would then have to iterate through the entire list and attempt to get all the parameters by ID in order to figure out which ID doesn't actually exist. This would be too tedious.

New behavior:

If attempting to assign nonexistent parameters to a profile, the error message should tell you only which parameters do not exist.

@rawlinp rawlinp added Traffic Ops related to Traffic Ops improvement The functionality exists but it could be improved in some way. labels Sep 21, 2021
@rawlinp
Copy link
Contributor Author

rawlinp commented Sep 21, 2021

The issue is w/ the query in this function:

func ParamsExist(ids []int64, tx *sql.Tx) (bool, error) {

The following query might work instead:

SELECT id FROM UNNEST($1::INT[]) AS id WHERE id NOT IN (SELECT id FROM parameter)

@rawlinp rawlinp added low difficulty the estimated level of effort to resolve this issue is low low impact affects only a small portion of a CDN, and cannot itself break one labels Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement The functionality exists but it could be improved in some way. low difficulty the estimated level of effort to resolve this issue is low low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant