Vendor-data missing

Problem:
Missing vendor-data

2022-12-30T12:33:14 [I|app|3ea601ed] Started GET “/userdata/vendor-data” for 10.237.9.135 at 2022-12-30 12:33:14 +0000
2022-12-30T12:33:14 [F|app|3ea601ed]
3ea601ed | ActionController::RoutingError (No route matches [GET] “/userdata/vendor-data”):
3ea601ed |
3ea601ed | lib/foreman/middleware/logging_context_request.rb:11:in `call’

Expected outcome:

Foreman and Proxy versions:
3.4.1
Foreman and Proxy plugin versions:

Distribution and version:
Installed on Ubuntu 20.04.5

Other relevant data:

Problem is in missing vendor-data, user-data and meta-data file are created and can be retreived successfully. Trying to provision Ubuntu 22.04.1 version, foreman 3.4.1 is installed on Ubuntu 20.04, Templates associated with OS are all predefined as below

Getting below after some time, so I suspect that problem is in not retreive vendor-data template, as it is only error inside of foreman production.log

Logs from /var/log/foreman/production.log

2022-12-30T12:32:27 [I|app|f352724c] Processing by HostsController#externalNodes as YML
2022-12-30T12:32:27 [I|app|f352724c] Parameters: {“name”=>“bdtforeman01.comhar.eircom.ie”}
2022-12-30T12:32:27 [I|app|f352724c] Rendered text template (Duration: 0.0ms | Allocations: 1)
2022-12-30T12:32:27 [I|app|f352724c] Completed 200 OK in 46ms (Views: 0.4ms | ActiveRecord: 10.1ms | Allocations: 14365)
2022-12-30T12:32:27 [I|app|f7ecc966] Started POST “/api/config_reports” for 10.237.9.31 at 2022-12-30 12:32:27 +0000
2022-12-30T12:32:27 [I|app|f7ecc966] Processing by Api::V2::ConfigReportsController#create as JSON
2022-12-30T12:32:27 [I|app|f7ecc966] Parameters: {“config_report”=>“[FILTERED]”, “apiv”=>“v2”}
2022-12-30T12:32:27 [I|app|f7ecc966] Scanning report with: Foreman::PuppetReportScanner, ForemanAnsible::AnsibleReportScanner
2022-12-30T12:32:27 [I|app|f7ecc966] Imported report for bdtforeman01.comhar.eircom.ie in 25.6 ms, status refreshed in 23.1 ms
2022-12-30T12:32:27 [I|app|f7ecc966] Rendered api/v2/config_reports/create.json.rabl (Duration: 2.2ms | Allocations: 827)
2022-12-30T12:32:27 [I|app|f7ecc966] Completed 201 Created in 70ms (Views: 3.6ms | ActiveRecord: 24.1ms | Allocations: 17750)
2022-12-30T12:33:08 [I|app|55d59347] Started GET “/userdata/meta-data” for 10.237.9.135 at 2022-12-30 12:33:08 +0000
2022-12-30T12:33:08 [I|app|55d59347] Processing by UserdataController#metadata as TEXT
2022-12-30T12:33:08 [I|app|55d59347] Rendered text template (Duration: 0.0ms | Allocations: 1)
2022-12-30T12:33:08 [I|app|55d59347] Completed 200 OK in 30ms (Views: 0.7ms | ActiveRecord: 9.1ms | Allocations: 2981)
2022-12-30T12:33:08 [I|app|5486478d] Started GET “/userdata/user-data” for 10.237.9.135 at 2022-12-30 12:33:08 +0000
2022-12-30T12:33:08 [I|app|5486478d] Processing by UserdataController#userdata as TEXT
2022-12-30T12:33:08 [I|app|5486478d] Rendered text template (Duration: 0.0ms | Allocations: 1)
2022-12-30T12:33:08 [I|app|5486478d] Completed 200 OK in 136ms (Views: 0.4ms | ActiveRecord: 18.6ms | Allocations: 84401)
2022-12-30T12:33:08 [I|app|8f97a528] Started GET “/userdata/vendor-data” for 10.237.9.135 at 2022-12-30 12:33:08 +0000
2022-12-30T12:33:08 [F|app|8f97a528]
8f97a528 | ActionController::RoutingError (No route matches [GET] “/userdata/vendor-data”):
8f97a528 |
8f97a528 | lib/foreman/middleware/logging_context_request.rb:11:in call' 2022-12-30T12:33:09 [I|app|793854f3] Started GET "/userdata/vendor-data" for 10.237.9.135 at 2022-12-30 12:33:09 +0000 2022-12-30T12:33:09 [F|app|793854f3] 793854f3 | ActionController::RoutingError (No route matches [GET] "/userdata/vendor-data"): 793854f3 | 793854f3 | lib/foreman/middleware/logging_context_request.rb:11:in call’
2022-12-30T12:33:10 [I|app|e7fd82b2] Started GET “/userdata/vendor-data” for 10.237.9.135 at 2022-12-30 12:33:10 +0000
2022-12-30T12:33:10 [F|app|e7fd82b2]
e7fd82b2 | ActionController::RoutingError (No route matches [GET] “/userdata/vendor-data”):

Apparentrly vendor data is not requiried, problem with my installation was indeed wrong setup of partition table used debian installer for autoinstall

1 Like

Thanks for sharing. I was struggling for 3 days with this issue.

1 Like

I’m still having this problem. This is the partition table I’m using:

<%#
kind: ptable
name: preseed cloud-init autoinstall LVM default
oses:
- Ubuntu 20.04 live-server and higher
-%>
storage:
  config:
  # Create ext space and mount it (8589934592 = 8GB)
  - device: disk-sda
    flag: ''
    grub_device: false
    id: partition-1
    number: 2
    preserve: false
    size: 8589934592
    type: partition
    wipe: superblock
  - fstype: ext4
    id: format-0
    preserve: false
    type: format
    volume: partition-1
  - device: format-0
    id: mount-0
    path: /dev/sda2
    type: mount
  # Create SWAP space and mount it (2147483648 = 2GB)
  - device: disk-sda
    flag: swap
    grub_device: false
    id: partition-2
    number: 4
    preserve: false
    size: 2147483648
    type: partition
    wipe: superblock
  - fstype: swap
    id: format-1
    preserve: false
    type: format
    volume: partition-3
  - device: format-1
    id: mount-2
    path: /dev/sda2
    type: mount

Any idea why is this happening? @gol19 @shanmugara

i am not very good with partition tables, but one of options is to put “autoinstall” but partition to be interactive, then after installation finish you can find your partition table on
/var/log/installer/autoinstall-user-data and then just tweak few things

Also i think that you need define ptable in your block, please check my below this is for CIS hardening with multiple partition for PXE Linux BIOS boot, for GRUB2 you need different one also to include where is boot file

storage:
config:

  • ptable: gpt
    path: /dev/sda
    wipe: superblock-recursive
    preserve: false
    name: ‘’
    grub_device: true
    type: disk
    id: disk-sda
  • device: disk-sda
    size: 1048576
    flag: bios_grub
    number: 1
    preserve: false
    grub_device: false
    type: partition
    id: partition-sda1
  • device: disk-sda
    size: 2147483648
    flag: linux
    number: 2
    wipe: superblock
    preserve: false
    grub_device: false
    type: partition
    id: partition-sda2
  • device: disk-sda
    size: -1
    wipe: superblock
    flag: linux
    number: 3
    wipe: superblock
    preserve: false
    grub_device: false
    type: partition
    id: partition-sda3
  • name: vg-root
    devices:
    • partition-sda3
      preserve: false
      type: lvm_volgroup
      id: lvm_volgroup-0
  • name: lv_home
    volgroup: lvm_volgroup-0
    size: 10737418240B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-0
  • fstype: ext4
    volume: lvm_partition-0
    preserve: false
    type: format
    id: format-0
  • name: lv_tmp
    volgroup: lvm_volgroup-0
    size: 3221225472B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-1
  • fstype: ext4
    volume: lvm_partition-1
    preserve: false
    type: format
    id: format-1
  • name: lv_var
    volgroup: lvm_volgroup-0
    size: 8589934592B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-2
  • fstype: ext4
    volume: lvm_partition-2
    preserve: false
    type: format
    id: format-2
  • name: lv_vartmp
    volgroup: lvm_volgroup-0
    size: 2147483648B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-3
  • fstype: ext4
    volume: lvm_partition-3
    preserve: false
    type: format
    id: format-3
  • name: lv_log
    volgroup: lvm_volgroup-0
    size: 4294967296B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-4
  • fstype: ext4
    volume: lvm_partition-4
    preserve: false
    type: format
    id: format-4
  • name: lv_audit
    volgroup: lvm_volgroup-0
    size: 2147483648B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-5
  • fstype: ext4
    volume: lvm_partition-5
    preserve: false
    type: format
    id: format-5
  • name: lv_root
    volgroup: lvm_volgroup-0
    size: -1
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-6
  • fstype: ext4
    volume: lvm_partition-6
    preserve: false
    type: format
    id: format-6
  • path: /
    device: format-6
    type: mount
    id: mount-6
  • path: /home
    device: format-0
    type: mount
    id: mount-0
  • path: /tmp
    device: format-1
    type: mount
    id: mount-1
  • path: /var
    device: format-2
    type: mount
    id: mount-2
  • path: /var/tmp
    device: format-3
    type: mount
    id: mount-3
  • path: /var/log
    device: format-4
    type: mount
    id: mount-4
  • path: /var/log/audit
    device: format-5
    type: mount
    id: mount-5

Thanks for replying @gol19. Actually I’m starting to think is not a partition table problem. I noticed that they VM I deploy tries to get a meta-data and a user-data with the name of a different VM, e.g, my Ubuntu 22 VM tries to get the meta-data and user-data files of an Oracle Linux VM that was deployed in the past. This cloud-init installation is quite confusing.

An update on the ptable problem. I found a configuration that works, with a /boot, / , and swap partion. Here is the configuration:

storage:
  config:
    - {ptable: gpt, wipe: superblock-recursive, preserve: false, grub_device: true, path: /dev/sda, type: disk, id: disk-sda}
    - {type: partition, wipe: superblock-recursive, number: 1, device: disk-sda, flag: bios_grub, size: 1M, id: sda-grub}
    - {type: partition, wipe: superblock-recursive, number: 2, device: disk-sda, flag: boot, size: 0.5G, id: sda-boot}
    - {type: partition, wipe: superblock, number: 3, device: disk-sda, flag: swap, grub_device: false, id: sda-swap, size: 2G}
    - {type: partition, wipe: superblock-recursive, number: 4, device: disk-sda, size: -1, id: sda-lvm}
    
    - {type: lvm_volgroup, name: vg-my, devices: [sda-lvm], id: vg-my}
    - {type: lvm_partition, volgroup: vg-my, id: lv-root, name: lv-root, size: 17G}
    
    - {type: format, fstype: ext4, volume: sda-boot, id: sda-boot-fs}
    - {type: format, fstype: ext4, volume: lv-root, id: lv-root-fs}
    - {type: format, fstype: swap, volume: sda-swap, id: sda-swap-fs}

    - {type: mount, path: /boot, id: m-boot, device: sda-boot-fs}
    - {device: sda-swap-fs, id: m-swap, path: '', type: mount}
    - {type: mount, path: /, id: m-root, device: lv-root-fs}