Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection.hostName is empty in the logs #161

Closed
mrvdb opened this issue Aug 8, 2019 · 9 comments · Fixed by #171

Comments

@mrvdb
Copy link
Collaborator

commented Aug 8, 2019

No UI behaviour mishap as far as I can see.

Upgrading to revision 8557119451f49638e69dc128a0842bd09e7dc9c9 on develop this line starts showing up in the logs and instructs to file a bug.

@thebaer

This comment has been minimized.

Copy link
Member

commented Aug 8, 2019

Thanks -- which requests do you see this on?

@mrvdb

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 8, 2019

all of them (well, almost)

@thebaer

This comment has been minimized.

Copy link
Member

commented Aug 8, 2019

Sharing any particular ones would be a huge help :)

@mrvdb

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 8, 2019

Not sure what I can add, the root at https://qua.name gives the error (4 times) Clicking on any blog (logged in), same.

A specific post, say https://qua.name/mrb/federated-writing-start doesn't show the error.

Editting a post does show it (https://qua.name/info/example-page/edit)

@mrvdb

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 8, 2019

In general: it seems only authenticated requests cause the error.

@thebaer

This comment has been minimized.

Copy link
Member

commented Aug 9, 2019

Thanks, that helps narrow it down. Will take a look.

@robjloranger

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

Found the issue here, there is no host name on any collection. not even in the DB schemas

So will need to update the schemas and write a migration, or change c.Hostname to a function that returns either the collection hostname if set or the configured app hostname otherwise.

@thebaer

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

Ah, that's not quite it... We don't want to store the hostName in the DB -- it's configured in config.ini. The problem is that we're manually setting it in various places, like this one:

writefreely/collections.go

Lines 450 to 454 in 8557119

c, err := app.db.GetCollection(alias)
if err != nil {
return err
}
c.hostName = app.cfg.App.Host

so that we don't have to pass in the app configuration into every database func. And we've missed a spot -- viewCollections() is one of those spots.

@robjloranger

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

oh ok, so only manual. much easier 😁

@robjloranger robjloranger referenced this issue Aug 12, 2019
1 of 1 task complete

@thebaer thebaer closed this in #171 Sep 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.