45Drives / cockpit-file-sharing

A Cockpit plugin to easily manage samba and NFS file sharing.
GNU General Public License v3.0
556 stars 30 forks source link

Unknown parameter encountered: "includes" #98

Open mgjsmith67 opened 8 months ago

mgjsmith67 commented 8 months ago

Hi, I am a very new Cockpit/File Sharing user on my Ubuntu Server. When I run testparm after modifying my smb.conf file I receive the following message: Load smb config files from /etc/samba/smb.conf Unknown parameter encountered: "includes" Unknown parameter encountered: "includes" Loaded services file OK. Weak crypto is allowed

When I import the smb.conf file into File Sharing without the inclusion of include = registry, I fix the resulting error and then check to confirm that this line is added to the smb.conf file. I then get the testparm error message. This is all I have in my Global section of the smb.conf file prior to adding the include = registry line: [Global] server string = UbuntuTower Server workgroup = WORKGROUP security = user map to guest = Bad User name resolve order = bcast host

I hope someone can advise me what is going on so thanks in advance. Martin

almereyda commented 7 months ago

I'm seeing the same error in /var/log/samba/log.smbd when setting log level to five.

joshuaboud commented 5 months ago

Can you attach the output of net conf list?

joshuaboud commented 5 months ago

I'm assuming the "includes" parameter somehow ended up in the global section of the net registry config for samba. You can remove it with this command: sudo net conf delparm global includes. Additionally, I think the section name in your smb.conf needs to be "global" and not "Global". Let me know if this works

RamonAbudAlcala commented 4 months ago

Exact same behaviour here, I was looking into net conf list but cannot see the word "includes". But I'm guessing it is there, it is just not parsed by the output of net conf list.

$ sudo net conf list
Unknown parameter encountered: "includes"
Unknown parameter encountered: "includes"
[global]
    workgroup = WORKGROUP
    log file = /var/log/samba/log.%m
    max log size = 1000
    logging = file
    panic action = /usr/share/samba/panic-action %d
    server role = standalone server
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    pam password change = yes
    map to guest = bad user
    usershare allow guests = yes
    include = /etc/cockpit/zfs/shares.conf

[homes]
    comment = Home Directories
    browseable = no
    read only = yes
    create mask = 0700
    directory mask = 0700
    valid users = %S

[printers]
    comment = All Printers
    browseable = no
    path = /var/tmp
    printable = yes
    guest ok = no
    read only = yes
    create mask = 0700

[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
    browseable = yes
    read only = yes
    guest ok = no

This is mildly interesting. It complains twice!

$ sudo net conf getparm global includes
Unknown parameter encountered: "includes"
Unknown parameter encountered: "includes"
Error: given parameter 'includes' is not set.

I'll run the command sudo net conf delparm global includes from your comment now :) It didn't work :(

$ sudo net conf delparm global includes
Unknown parameter encountered: "includes"
Unknown parameter encountered: "includes"
Error: given parameter 'includes' is not set.

Also, I'm running debian bookworm:

$ uname -a
Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
$ apt search cockpit-file-sharing
cockpit-file-sharing/focal,now 3.3.7-1focal all [installed]
RamonAbudAlcala commented 4 months ago

Uh! I've been reading a bit, and just found the registry! Since there is no sign of the string "includes" anywhere in samba's plain text files, I bet it is somewhere in the registry.

$ sudo net REGISTRY CHECK
Unknown parameter encountered: "includes"
Check database: /var/lib/samba/registry.tdb
INFO: version = 3

Unfortunately, I don't know how to access a database like this one (.tdb).

joshuaboud commented 3 months ago

What is the contents of /etc/cockpit/zfs/shares.conf? Maybe something in that file is misconfigured.

moutasem1989 commented 3 months ago

I had the same issue but got it fixed by setting SAMBA password

RamonAbudAlcala commented 3 months ago

@joshuaboud Hi, thanks for your reply. Unfortunately, right now is empty because I started using samba manually with its config file. The remaining configuration from 45drives in /etc/samba/smb.conf is this:

        # COCKPIT ZFS MANAGER
    # WARNING: DO NOT EDIT, AUTO-GENERATED CONFIGURATION
    include = /etc/cockpit/zfs/shares.conf
    # inclusion of net registry, inserted by cockpit-file-sharing:
    include = registry

Running the command above sudo net conf getparm global includes still gives me the Unknown parameter encountered: "includes" error.

I'm happy to test stuff. What is the most basic configuration that etc/cockpit/zfs/shares.conf should have?


@moutasem1989 Unfortunately, I already have a samba password.