Project

General

Profile

Actions

Bug #9790

closed

Error when accessing change request

Added by Nicolas CHARLES almost 8 years ago. Updated almost 8 years ago.

Status:
Released
Priority:
1 (highest)
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

On change request page, the following error happens:
Error when retrieving the last action

it's caused by invalid sql queries

2016-12-07 15:27:12 UTC [6165]: [3873-1] ERROR:  operator does not exist: text[] = character varying[] at character 210
2016-12-07 15:27:12 UTC [6165]: [3874-1] HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
2016-12-07 15:27:12 UTC [6165]: [3875-1] STATEMENT:  
          select eventtype, id, modificationid, principal, creationdate, causeid, severity, reason, data
          from eventlog
          where cast (xpath('/entry/workflowStep/changeRequestId/text()', data) as text[]) = $1
           and eventType in ($2)  

sadly, no logs show that there is an error

Actions #1

Updated by Nicolas CHARLES almost 8 years ago

  • Assignee set to François ARMAND

it is a type issue, query is valid, but $1 should be something like '{1}'
before we used a

ps.setArray(1, connection.createArrayOf("text", Seq(changeRequest.value.toString).toArray[AnyRef]) ), and now a 

val param = ( HPS.set(1, List(changeRequest.value.toString)) /: eventTypeParam ) { case (current, (event,index)) =>
      // zipwithIndex starts at 0, and we have already 1 used for the array, so we +2 the index
      current *> HPS.set(index+2, event.eventType.serialize)
    }

Actions #2

Updated by François ARMAND almost 8 years ago

  • Status changed from New to In progress
Actions #3

Updated by François ARMAND almost 8 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder/pull/1403
Actions #4

Updated by François ARMAND almost 8 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #5

Updated by Vincent MEMBRÉ almost 8 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.0.2 which was released today.

Actions

Also available in: Atom PDF