Group Group Group Group Group Group Group Group Group

Chapter 6: PostgreSQL Error: No password is required

#1

After getting the PushNotifications project working, I ran into an issue where Fluent was complaining about the trust level access to the apns db.


The error in the console looks like this:

:warning: [PostgreSQLError.trust: No password is required]

[WARNING] [Async] [QueueHandler] Read triggered when input queue was empty, ignoring: parameterStatus(application_name: ).


In order to get a fix on exactly what was happening, I set a breakpoint on line 36 of the main.swift file where the line states:

var config = Config.default()

I also had the debuger give me a more detailed view of what was inside the error by running the print object command in the output window of Xcode.

po error

This output gives a little more details

:warning: PostgreSQL Error: No password is required

  • id: PostgreSQLError.trust

    • identifier : “trust”
    • reason : “No password is required”

If anyone runs into this issue while working through the Vapor example Chapter 6, you might need to do as I did ( or maybe there is a better way to fix this ).


I found the following article on the Vapor GitHub repository that pointed me in the right direction.

My fix involves:

Making the password an optional value:
let password: String?

And, setting password to nil ( i.e. NOT including my password in the call )

Now this works, and I have been able to verify the functionality as directed in the book via RESTed ( I love that tool !! )

Sincerely,
John Tyler

#2

@synerjohnny Thank you for sharing your solution - much appreciated! :]