ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.08k stars 3.42k forks source link

Cannot create scheduler, error in momentjs #1324

Closed de1m closed 6 years ago

de1m commented 6 years ago
ISSUE TYPE
COMPONENT NAME
STEPS TO REPRODUCE

Login in to UI Go to template and start the creation of scheduler Write name and click "Save"

EXPECTED RESULTS

Popup with:

Valid DTSTART required in rrule. Value should start with: DTSTART:YYYYMMDDTHHMMSSZ
In Webbrowser console
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 02/21/2018, _f: undefined, _strict: undefined, _locale: [object Object]
Error
    at Function.createFromInputFallback (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:5498)
    at configFromString (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:33143)
    at configFromInput (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:36751)
    at prepareConfig (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:36507)
    at createFromConfig (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:35978)
    at createLocalOrUTC (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:37327)
    at createLocal (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:37403)
    at hooks (http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:1:1129)
    at http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:583:46022
    at http://tower.aditosoftware.local/static/js/vendor.79e5e4d0a371a5440421.js:583:53915

vendor.79e5e4d0a371a5440421.js:570 POST 
http://tower.firma.local/api/v2/job_templates/5/schedules/ 400 (Bad Request)
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
sendReq @ vendor.79e5e4d0a371a5440421.js:570
serverRequest @ vendor.79e5e4d0a371a5440421.js:570
processQueue @ vendor.79e5e4d0a371a5440421.js:570
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
$digest @ vendor.79e5e4d0a371a5440421.js:570
$apply @ vendor.79e5e4d0a371a5440421.js:570
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
dispatch @ vendor.79e5e4d0a371a5440421.js:29
elemData.handle @ vendor.79e5e4d0a371a5440421.js:29
vendor.79e5e4d0a371a5440421.js:570 Possibly unhandled rejection: undefined
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
processChecks @ vendor.79e5e4d0a371a5440421.js:570
$digest @ vendor.79e5e4d0a371a5440421.js:570
$apply @ vendor.79e5e4d0a371a5440421.js:570
done @ vendor.79e5e4d0a371a5440421.js:570
completeRequest @ vendor.79e5e4d0a371a5440421.js:570
xhr.onload @ vendor.79e5e4d0a371a5440421.js:570
XMLHttpRequest.send (async)
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
sendReq @ vendor.79e5e4d0a371a5440421.js:570
serverRequest @ vendor.79e5e4d0a371a5440421.js:570
processQueue @ vendor.79e5e4d0a371a5440421.js:570
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
$digest @ vendor.79e5e4d0a371a5440421.js:570
$apply @ vendor.79e5e4d0a371a5440421.js:570
(anonymous) @ vendor.79e5e4d0a371a5440421.js:570
dispatch @ vendor.79e5e4d0a371a5440421.js:29
elemData.handle @ vendor.79e5e4d0a371a5440421.js:29
ACTUAL RESULTS

I cannot create a scheduler, but other functions working

ADDITIONAL INFORMATION

I've started this in docker and I've used the lates version(10 hours) of awx_task and awx_web

candlerb commented 6 years ago

I get this problem as well if attempting to edit one of the three default schedules:

image

Setting a timezone is required to make the "Save" button become undimmed, but then clicking it gives:

image

de1m commented 6 years ago

it's working in new docker image (awx_web)

candlerb commented 6 years ago

Is there a recommended way to redeploy just the awx_web container leaving everything else unchanged (i.e. avoid having to redeploy from scratch)?

jaredevantabor commented 6 years ago

You can rerun the install playbook to pull in the latest change - it should only update the specific things that have changed in the new version. Let us know if you still see this issue.

candlerb commented 6 years ago

Doesn't seem to do very much: almost all tasks skipped, it doesn't destroy or recreate any docker containers, and the problem is still there.

Showing only the non-skipped tasks:

git pull
...
time ansible-playbook -i inventory install.yml
...
TASK [check_vars : postgres_data_dir should be defined] *******************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [check_vars : host_port should be defined] ***************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

...
TASK [local_docker : Set DockerHub Image Paths] ***************************************************************************************
ok: [localhost]

TASK [local_docker : Activate postgres container] *************************************************************************************
ok: [localhost]

TASK [local_docker : Activate rabbitmq container] *************************************************************************************
ok: [localhost]

TASK [local_docker : Activate memcached container] ************************************************************************************
ok: [localhost]

...

TASK [local_docker : Set properties with postgres for awx_web] ************************************************************************
ok: [localhost]

...

TASK [local_docker : Set properties with postgres for awx_web] ************************************************************************
ok: [localhost]

...

TASK [local_docker : Set properties with postgres for awx_task] ***********************************************************************
ok: [localhost]

TASK [local_docker : Activate AWX Web Container] **************************************************************************************
ok: [localhost]

TASK [local_docker : Activate AWX Task Container] *************************************************************************************
ok: [localhost]

...

PLAY RECAP ****************************************************************************************************************************
localhost                  : ok=11   changed=0    unreachable=0    failed=0

real    0m6.350s
user    0m4.488s
sys 0m1.940s

And:

root@awx:~/awx/installer# docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                                NAMES
6736258a4010        ansible/awx_task:latest   "/tini -- /bin/sh -c…"   23 hours ago        Up 23 hours         8052/tcp                             awx_task
a9adadb288a3        ansible/awx_web:latest    "/tini -- /bin/sh -c…"   23 hours ago        Up 23 hours         0.0.0.0:80->8052/tcp                 awx_web
c3c97fe0ca28        memcached:alpine          "docker-entrypoint.s…"   23 hours ago        Up 23 hours         11211/tcp                            memcached
d35003bea92a        rabbitmq:3                "docker-entrypoint.s…"   23 hours ago        Up 23 hours         4369/tcp, 5671-5672/tcp, 25672/tcp   rabbitmq
0e564b459baa        postgres:9.6              "docker-entrypoint.s…"   23 hours ago        Up 23 hours         5432/tcp                             postgres
niyazielvan commented 6 years ago

Hi,

docker stop a9adadb288a3 docker rm a9adadb288a3

will destroy the web container. When you run the installer, you will get a fresh instance.

candlerb commented 6 years ago

Thanks, I've now done that but it doesn't fix the problem. Still get (when trying to re-save the Cleanup Job Schedule):

"Valid DTSTART required in rrule. Value should start with: DTSTART:YYYYMMDDTHHMMSSZ"

Turning on network logging in Chrome, I see the request looks like this:

{rrule: "DTSTART;TZID=Europe/London:undefined RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU", id: 1,…}
created: "2018-02-22T18:29:28.987361Z"
description: "every week on Sunday"
diff_mode: null
dtend: null
dtstart: "2018-02-25T18:29:28Z"
enabled: true
extra_data: "{"days":15}"
id: 1
inventory: null
job_tags: null
job_type: null
limit: null
modified: "2018-02-25T18:29:28.618572Z"
name: "Cleanup Job Schedule"
next_run: "2018-03-04T18:29:28Z"
related: {credentials: "/api/v2/schedules/1/credentials/", unified_jobs: "/api/v2/schedules/1/jobs/",…}
rrule: "DTSTART;TZID=Europe/London:undefined RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU"
skip_tags: null
summary_fields: {,…}
type: "schedule"
unified_job_template: 1
url: "/api/v2/schedules/1/"
verbosity: null

And the response is a 400 with

{"rrule":["Valid DTSTART required in rrule. Value should start with: DTSTART:YYYYMMDDTHHMMSSZ"]}

Clearly the rrule in the request does not match the given format.

de1m commented 6 years ago

maybe you need to delete the old docker image:

docker rmi ansible/awx_web
niyazielvan commented 6 years ago

Yes @de1m , I forgot to add it. You need to delete the old image and installer will download the latest image that works properly.

candlerb commented 6 years ago

OK that fixed it, thanks!

jschwanz commented 6 years ago

I was having the same trouble on 1.0.4.7, and updating to 1.0.4.14 resolved it for me.

anlutro commented 6 years ago

I'm running AWX 1.0.4.38, and while I can create and edit schedules, the error message "The scheduler options are invalid or incomplete." still shows up on all my existing jobs, and I have to re-enter the schedule's time data because they've all been blanked. This seems to be because of a change in how the rrule column is structured, it would be nice if this was made backwards compatible.

jaredevantabor commented 6 years ago

A fix for this has landed in devel.