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

defaulthostname warning occurs when it shouldn't #118

Open
agarwal opened this issue Dec 21, 2016 · 6 comments
Open

defaulthostname warning occurs when it shouldn't #118

agarwal opened this issue Dec 21, 2016 · 6 comments

Comments

@agarwal
Copy link

agarwal commented Dec 21, 2016

I'm passing a config file like this to ocsigenserver

<ocsigen>
  <server>
    ...
    <host defaulthostname="localhost">
      <eliom mysite.cma">
      </eliom>
    </host>
  </server>
</ocsigen>

and I get the warning:

ocsigenserver: ocsigen:config: Cannot determine default host name. Will use "mylaptop.local" to create absolute links or redirections dynamically if you do not set <host defaulthostname="..." ...> in config file.

Why? The config file does set defaulthostname exactly as suggested in the warning. This didn't used to happen. I upgraded ocsigenserver recently, so maybe a bug was introduced.

@agarwal
Copy link
Author

agarwal commented Jan 12, 2017

I've confirmed that the defaulthostname config setting is not getting picked. So the warning is actually correct. The error is that the setting isn't detected. I've also set defaultprotocol and that works fine.

@balat
Copy link
Member

balat commented Jan 12, 2017

I was unable to reproduce this.
I tried with version 48e67b4 and with the very last
079bf86 ...

Do you have several hosts in the config file?

@agarwal
Copy link
Author

agarwal commented Jan 12, 2017

Weird. I'm on 079bf86 and have the same problem in 2 different projects. Config files are fairly simple. Here's a complete one.

$ cat config.xml 
<ocsigen>
  <server>
    <debugmode/>
    <port protocol="HTTP">8082</port>
    <logdir>_var/log</logdir>
    <datadir>_var/data</datadir>
    <charset>utf-8</charset>
    <extension findlib-package="core"/>
    <extension findlib-package="ocsigenserver.ext.staticmod"/>
    <extension findlib-package="ocsigenserver.ext.ocsipersist-sqlite"/>
    <extension findlib-package="eliom.server"/>

    <host defaulthostname="localhost">
      <static dir="_build/_site/" />
      <eliom xhr-links="no" module="_build/_server/eliom-starter.cma">
      </eliom>
    </host>

  </server>
</ocsigen>

@agarwal
Copy link
Author

agarwal commented Jan 12, 2017

It only happens on my Mac, not Ubuntu.

@balat
Copy link
Member

balat commented Jan 13, 2017

I just tried on MacOS but it works for me ...

Are you sure you don't have something weird with your configuration files?
Do you have other differences in the config files?

@agarwal
Copy link
Author

agarwal commented Feb 27, 2017

I haven't been able to pin down a reproducible example of this, but it still happens at various times. I'll report more when I have something useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants