Skip to content

Segmentation violation on FreeBSD 13.1 #620

Description

I am trying to set up a fresh install of writefreely 0.13.2 on FreeBSD 13.1 (MySQL backend) and getting a segfault when trying to create an admin user (i selected the multi-user instance option during configuration).

The package is directly from FreeBSD repositories.
image

Activity

  1. thebaer commented on Jan 6, 2023

    @thebaer
    Member

    I'm able to replicate this if the pages directory is gone. We don't maintain the FreeBSD package, so this issue will need to be brought up with them to fix this particular installation issue.

    As for us, I'll mark this as an error message issue, so we can print out something more user-friendly when this happens in the future.

  2. added a commit that references this issue on Jan 6, 2023
    99d7288
  3. added this to the 1.0 milestone on Jan 6, 2023
  4. clausecker commented on Jan 7, 2023

    @clausecker

    We do ship the pages directory, so I'm not sure what the specific problem is.

  5. clausecker commented on Jan 7, 2023

    @clausecker

    It is possible that the binary is looking for the pages directory in the wrong place. Following FreeBSD conventions, we are installing the binary into /usr/local/bin, whereas the files served by HTTP go to /usr/local/www. I'm currently investigating this.

  6. thebaer commented on Jan 23, 2023

    @thebaer
    Member

    @clausecker do you have static_parent_dir, pages_parent_dir, etc. set to /usr/local/www in the config file?

  7. clausecker commented on Jan 23, 2023

    @clausecker

    @thebaer We have the user run the command

    su -m "$writefreely_user" -c "/usr/local/bin/writefreely -c '$writefreely_config' config start"
    

    to generate the configuration file. We do not edit the config file afterwards. A sample config file generated from this command looks like this:

    [server]
    hidden_host          = 
    port                 = 8080
    bind                 = localhost
    tls_cert_path        = 
    tls_key_path         = 
    autocert             = false
    templates_parent_dir = 
    static_parent_dir    = 
    pages_parent_dir     = 
    keys_parent_dir      = 
    hash_seed            = 
    gopher_port          = 0
    
    [database]
    type     = sqlite3
    filename = writefreely.db
    username = 
    password = 
    database = 
    host     = localhost
    port     = 3306
    tls      = false
    
    [app]
    site_name             = admin
    site_description      = 
    host                  = http://localhost:8080
    theme                 = write
    editor                = 
    disable_js            = false
    webfonts              = true
    landing               = 
    simple_nav            = false
    wf_modesty            = false
    chorus                = false
    forest                = false
    disable_drafts        = false
    single_user           = true
    open_registration     = false
    open_deletion         = false
    min_username_len      = 3
    max_blogs             = 1
    federation            = false
    public_stats          = true
    monetization          = false
    notes_only            = false
    private               = false
    local_timeline        = false
    user_invites          = 
    default_visibility    = 
    update_checks         = false
    disable_password_auth = false
    
    [oauth.slack]
    client_id          = 
    client_secret      = 
    team_id            = 
    callback_proxy     = 
    callback_proxy_api = 
    
    [oauth.writeas]
    client_id          = 
    client_secret      = 
    auth_location      = 
    token_location     = 
    inspect_location   = 
    callback_proxy     = 
    callback_proxy_api = 
    
    [oauth.gitlab]
    client_id          = 
    client_secret      = 
    host               = 
    display_name       = 
    callback_proxy     = 
    callback_proxy_api = 
    
    [oauth.gitea]
    client_id          = 
    client_secret      = 
    host               = 
    display_name       = 
    callback_proxy     = 
    callback_proxy_api = 
    
    [oauth.generic]
    client_id          = 
    client_secret      = 
    host               = 
    display_name       = 
    callback_proxy     = 
    callback_proxy_api = 
    token_endpoint     = 
    inspect_endpoint   = 
    auth_endpoint      = 
    scope              = 
    allow_disconnect   = false
    map_user_id        = 
    map_username       = 
    map_display_name   = 
    map_email          = 
    

    The writefreely daemon is started with its working directory being /usr/local/www/writefreely, which contains the pages, templates, and static directories. It starts and serves the blog just fine. Is there some extra configuration we need to perform?

  8. clausecker commented on Jan 23, 2023

    @clausecker

    @realseb1g Does the problem still occur if you execute this command from /usr/local/www/writefreely?

  9. clausecker commented on Jan 23, 2023

    @clausecker

    @realseb1g Thanks, I'll note this as a possible workaround. @thebaer what do you recommend we do to fix this? Is there an easy way to correctly set these configuration keys on initial config generation?

  10. thebaer commented on Jan 24, 2023

    @thebaer
    Member

    There isn't anything built in to the application to set those values. But the config process only alters values it asks about. So you could supply a default config.ini file with just the values you want populated, then when users run writefreely config start, the process will fill in the rest without overwriting them. For example:

    [server]
    templates_parent_dir = /usr/local/www
    static_parent_dir = /usr/local/www
    pages_parent_dir = /usr/local/www
    
  11. clausecker commented on Jan 24, 2023

    @clausecker

    @thebaer That's a good idea! I'll go ahead and try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messageIssues related to bad error messages

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions