Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2955 closed defect (fixed)

Force button not working: $digest already in progress

Reported by: Ben Owned by: tardyp
Priority: major Milestone: 0.9.0
Version: master Keywords: www
Cc:

Description

Happens everytime I press on the Force button.

POST http://scaphoid.gb.intevation.de:8020/api/v2/forceschedulers/force 400 (Bad Request) vendors.js:4
(anonymous function) vendors.js:4
v vendors.js:4
u vendors.js:4
c vendors.js:5
c vendors.js:5
(anonymous function) vendors.js:5
c.$eval vendors.js:5
c.$digest vendors.js:5
c.$apply vendors.js:5
(anonymous function) vendors.js:6
Z.event.dispatch vendors.js:2
v.handle vendors.js:2
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.2.23/$rootScope/inprog?p0=%24digest
    at http://scaphoid.gb.intevation.de:8020/scripts.js:3:20673
    at f (http://scaphoid.gb.intevation.de:8020/scripts.js:5:10061)
    at c.$apply (http://scaphoid.gb.intevation.de:8020/scripts.js:5:13971)
    at http://scaphoid.gb.intevation.de:8020/scripts.js:4903:31
    at f (http://scaphoid.gb.intevation.de:8020/scripts.js:5:7885)
    at http://scaphoid.gb.intevation.de:8020/scripts.js:5:8644
    at c.$eval (http://scaphoid.gb.intevation.de:8020/scripts.js:5:13710)
    at c.$digest (http://scaphoid.gb.intevation.de:8020/scripts.js:5:12235)
    at c.$apply (http://scaphoid.gb.intevation.de:8020/scripts.js:5:14029)
    at u (http://scaphoid.gb.intevation.de:8020/scripts.js:4:24760) vendors.js:5
(anonymous function) vendors.js:5
(anonymous function) vendors.js:4
c.$apply vendors.js:5
(anonymous function) forcedialog.controller.coffee:39
f vendors.js:5
(anonymous function) vendors.js:5
c.$eval vendors.js:5
c.$digest vendors.js:5
c.$apply vendors.js:5
u vendors.js:4
m vendors.js:4
x.onreadystatechange

Change History (8)

comment:1 Changed 5 years ago by Ben

This is my scheduler configuration:

c['schedulers'].append(schedulers.ForceScheduler(
                            name="force",
                            builderNames=['manager']))

comment:2 Changed 5 years ago by Ben

  • Keywords www added
  • Summary changed from Forec button not working: $digest already in progress to Force button not working: $digest already in progress

comment:3 Changed 5 years ago by Ben

This is an example of payload that returns a 400:

{
  "method":"force",
  "id":1,
  "params":{
    "builderid":"4",
    "username":"ben",
    "reason":"force build",
    "project":"blah",
    "repository":"bloh",
    "branch":"blih",
    "revision":"bluh"
  },
  "jsonrpc":"2.0"
}

(Indentation is mine)

comment:4 Changed 5 years ago by Ben

And this is the issue: HTTP error: invalid origin

comment:6 Changed 5 years ago by sa2ajj

  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from 0.8.9 to master

I just merged the PR, thank you :)

comment:7 Changed 5 years ago by Ben

Note that the question remains why does that POST request is the only one to have its Origin checked ...

comment:8 Changed 5 years ago by dustin

CORS is tricky. The browser will pre-check a POST by making a HEAD request first. For GETs, since they should not have side effects, the browser checks the origin-related headers in the response, and only allows the AJAX request to complete successfully if the check succeeds.

Note: See TracTickets for help on using tickets.