PolkitErrorTextual Authentication Agent

How to fix the following polkit error:

***Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address (polkit-error-quark, 0)