Project

General

Profile

action #58490

400 bad request error msg popup after load_templates --update

Added by coolgw 9 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Concrete Bugs
Target version:
Start date:
2019-10-22
Due date:
% Done:

0%

Estimated time:
Difficulty:
Duration:

Description

Try to do update operation but 400 back.

linux-4360:/usr/share/openqa/script # ./dump_templates --host localhost --group "cc" --json --full >bb.json
linux-4360:/usr/share/openqa/script # ./load_templates bb.json --update 
{
  JobGroups    => [
                    {
                      group_name => "cc",
                      template   => "defaults:\n  x86_64:\n    machine: 64bit\n    priority: 50\nproducts:\n  aa-aa-Server-DVD-x86_64:\n    distri: aa\n    flavor: Server-DVD\n    version: aa\nscenarios:\n  x86_64:\n    aa-aa-Server-DVD-x86_64:\n    - '1'\n",
                    },
                  ],
  JobTemplates => [
                    {
                      group_name => "cc",
                      machine => { name => "64bit" },
                      prio => 50,
                      product => {
                        arch    => "x86_64",
                        distri  => "aa",
                        flavor  => "Server-DVD",
                        group   => "aa-aa-Server-DVD",
                        version => "aa",
                      },
                      test_suite => { name => 1 },
                    },
                  ],
  Machines     => [
                    {
                      backend => "qemu",
                      name => "64bit",
                      settings => [
                        { key => "HDDSIZEGB", value => 20 },
                        { key => "QEMUCPU", value => "qemu64" },
                        { key => "VIRTIO_CONSOLE", value => 1 },
                        { key => "WORKER_CLASS", value => "qemu_x86_64" },
                      ],
                    },
                  ],
  Products     => [
                    {
                      arch     => "x86_64",
                      distri   => "aa",
                      flavor   => "Server-DVD",
                      settings => [],
                      version  => "aa",
                    },
                  ],
  TestSuites   => [{ name => 1, settings => [] }],
}
ERROR: 400 - Bad Request
{
  error => [
    "Job template name '1' with aa-aa-Server-DVD-x86_64 and 64bit is already used in job group 'cc'",
  ],
  error_status => 400,
  id => 3,
}
{
  JobGroups    => { added => 0, of => 1 },
  JobTemplates => { added => 0, of => 1 },
  Machines     => { added => 1, of => 1 },
  Products     => { added => 1, of => 1 },
  TestSuites   => { added => 1, of => 1 },
}

History

#1 Updated by Xiaojing_liu 9 months ago

  • Subject changed from 400 bad request error msg popup after dump_templates --update to 400 bad request error msg popup after load_templates --update

#2 Updated by coolgw 9 months ago

After further check, i found it indeed can update content if i change some content in json file(such as change setting value of test suite).
But if i change the setting of JobTemplates, then it can not take effect.

 {
    "JobTemplates" : [
       {
          "group_name" : "bb",
          "test_suite" : {
             "name" : "111"
          },
          "settings" : [
             {
                "key" : "ADDONS",
                "value" : "xxx"   <==== try to change this value and try loadtemplate, it will not take effect.
             },
             {
                "key" : "BOOTFROM",
                "value" : "xxx1"
             }
          ],

#3 Updated by cdywan 8 months ago

On a general note for the future, I'd find it helpful if the steps didn't rely on a local instance and code markup were used (I need to reconstruct the YAML document from the command output as seen when editing the description, and guess what the test suites are). You can do that by adding "```" before and after the code.

defaults:
  x86_64:
    machine: 64bit
    priority: 50
products:
  aa-aa-Server-DVD-x86_64:
    distri: aa
    flavor: Server-DVD
    version: aa
scenarios:
  x86_64:
    aa-aa-Server-DVD-x86_64:
    - '1'

#4 Updated by cdywan 8 months ago

  • Description updated (diff)

#5 Updated by cdywan 8 months ago

  • Category set to Concrete Bugs
  • Status changed from New to Workable
  • Target version set to Current Sprint

It seems like this can be reproduced pretty easily with a random group, or maybe I was lucky. But it seems that there's a bug in detecting unique job templates even when nothing was changed.

#6 Updated by Xiaojing_liu 8 months ago

  • Category deleted (Concrete Bugs)
  • Assignee set to Xiaojing_liu

#7 Updated by Xiaojing_liu 8 months ago

  • Category set to Concrete Bugs

#9 Updated by Xiaojing_liu 8 months ago

  • Status changed from Workable to Feedback

#10 Updated by Xiaojing_liu 8 months ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF