Regex Fail when handling Tape in Frontend

Jul 1, 2024
7
0
1
Hi,

we have a IBM Tape lib with 730 Slots we used to run with TSM but now moved to PBS. I tried interfacing the TS4500 with Proxmox and it works mostly.

We connected 4 Drives and once i figured out the drive ids for the exposed drives they can do stuff and the changer works as well.

What doesn't work is handling Tapes in the Frontend. Moving a tape to a drive or trying to format it results in an error.

Screenshot From 2026-02-10 20-13-16.png

Screenshot From 2026-02-10 20-13-22.png

Same error when trying to format.

Labeling tapes with the Barcode Label button works. Tape Backup jobs also get tapes from the changer and do stuff. Moving Tapes from Slot to slot also works.

Code:
┌───────────────────────────────────────┬────────┬──────────┬──────────────────┐
│ path                                  │ vendor │ model    │ serial           │
╞═══════════════════════════════════════╪════════╪══════════╪══════════════════╡
│ /dev/tape/by-id/scsi-0000078BB2500401 │ IBM    │ 03584L32 │ 0000078BB2xxxxxx │
└───────────────────────────────────────┴────────┴──────────┴──────────────────┘

┌──────┬───────────────────────────────────────┬────────┬──────────┬──────────────────┐
│ name │ path                                  │ vendor │ model    │ serial           │
╞══════╪═══════════════════════════════════════╪════════╪══════════╪══════════════════╡
│ vtl0 │ /dev/tape/by-id/scsi-0000078BB2500401 │ IBM    │ 03584L32 │ 0000078BB2xxxxxx │
└──────┴───────────────────────────────────────┴────────┴──────────┴──────────────────┘

Code:
┌───────────────┬──────────┬────────────┬─────────────┐
│ entry-kind    │ entry-id │ label-text │ loaded-slot │
╞═══════════════╪══════════╪════════════╪═════════════╡
│ drive         │        0 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ drive         │        1 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ drive         │        2 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ drive         │        3 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ drive         │        4 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ import-export │       36 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ import-export │      731 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ import-export │      732 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ import-export │      733 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ import-export │      734 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ import-export │      735 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
[..]

│ import-export │      985 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        1 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        2 │ N01038L7^@^@ │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        3 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        4 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        5 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        6 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        7 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        8 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │        9 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       10 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       11 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       12 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       13 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       14 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       15 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       16 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       17 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       18 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       19 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       20 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       21 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       22 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       23 │ P0025SL7^@^@ │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       24 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │       25 │            │             │
[..]
│ slot          │      725 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │      726 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │      727 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │      728 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │      729 │            │             │
├───────────────┼──────────┼────────────┼─────────────┤
│ slot          │      730 │            │             │
└───────────────┴──────────┴────────────┴─────────────┘

The tapes show with ^@^@ at the end but in the frontend the correct labels show.

When i manually load a tape with e.g. proxmox-tape load-media-from-slot 2 --drive drive4 i can do all but the Label Media drive operations with the loaded drive, format and eject works.

Looks like a regex bug somewhere, what do you recommend I do?

pbs version 4.1.1

Thanks
 
Last edited:
upon further investigation it looks like i can reproduce the issue in commandline. ^@^@ is a null character or at least non-printable. that's why it probably doesn't show in the frontend however it is there.

root@pbs2:~# proxmox-tape load-media P0025SL7 --drive drive2
loading media 'P0025SL7' into drive 'drive2'
TASK ERROR: unable to find media 'P0025SL7' (offline?)
Error: task failed (status unable to find media 'P0025SL7' (offline?))


root@pbs2:~# proxmox-tape load-media P0025SL7^@^@ --drive drive2
Error: parameter verification failed - 'label-text': value does not match the regex pattern
Usage: proxmox-tape load-media <label-text> [OPTIONS]

<label-text> <string>
Media Label/Barcode.

Optional parameters:

--drive <string>
Drive Identifier.
--output-format text|json|json-pretty
Output format.
root@pbs2:~#

it looks like a bug in reading the library inventory. i would guess some functions use load media from slot and some functions load by ID hence the problem in different usecases.

should i report that as bug?
 
Last edited:
When starting a backup job it seems there is no regex in place (or it load by slot, no idea) but it works. I have yet to find where the ^@ comes from.

Code:
2026-02-10T20:44:39+01:00: Starting tape backup job 'backup:pool1:drive4:testbackup'
2026-02-10T20:44:39+01:00: update media online status
2026-02-10T20:44:40+01:00: media set uuid: 85fe54bf-cb2c-4a34-957f-17c2981e7666
2026-02-10T20:44:40+01:00: found 125 groups (out of 125 total)
2026-02-10T20:44:40+01:00: latest-only: true (only considering latest snapshots)
2026-02-10T20:44:40+01:00: backup snapshot "ns/pbs1/ns/prod-dmz/vm/900/2026-02-09T22:00:01Z"
2026-02-10T20:44:40+01:00: allocated new writable media 'N01038L7^@^@'
2026-02-10T20:44:40+01:00: trying to load media 'N01038L7^@^@' into drive 'drive4'
2026-02-10T20:45:00+01:00: found media label N01038L7^@^@ (ba664087-ee84-4b6d-a989-b99d0b8ce95c)
2026-02-10T20:45:00+01:00: writing new media set label
 
Last edited:
found it.

Code:
root@pbs2:/dev/tape/by-id# pmtx  status --changer vtl0
using device /dev/tape/by-id/scsi-0000078BB2500401   
Transport Element (Griper)      0: Empty
Transport Element (Griper)      1: Empty
Data Transfer Element (Drive)   0: Empty, Serial: 00078D1C05
Data Transfer Element (Drive)   1: Empty
Data Transfer Element (Drive)   2: Empty, Serial: 000781FCAB
Data Transfer Element (Drive)   3: Empty, Serial: 00078D232F
Data Transfer Element (Drive)   4: Empty, Serial: 00078D240E
  Storage Element   1: Empty
  Storage Element   2: Empty
  Storage Element   3: Empty
  Storage Element   4: Empty
  Storage Element   5: Empty
  Storage Element   6: Empty
  Storage Element   7: VolumeTag("N01038L7\0\0")
  Storage Element   8: Empty
  Storage Element   9: Empty
  Storage Element  10: Empty
  Storage Element  11: Empty
  Storage Element  12: Empty
  Storage Element  13: Empty
  Storage Element  14: Empty
  Storage Element  15: Empty
  Storage Element  16: Empty
  Storage Element  17: Empty
  Storage Element  18: Empty
  Storage Element  19: Empty
  Storage Element  20: Empty
  Storage Element  21: Empty
  Storage Element  22: Empty
  Storage Element  23: VolumeTag("P0025SL7\0\0")
  Storage Element  24: Empty
  Storage Element  25: Empty
 
compared with mtx:
Code:
root@pbs2:/dev/tape/by-id# mtx -f  /dev/tape/by-id/scsi-1IBM_03584L32_0000078BB2500401-changer status
  Storage Changer /dev/tape/by-id/scsi-1IBM_03584L32_0000078BB2500401-changer:5 Drives, 985 Slots ( 255 Import/Export )
Data Transfer Element 0:Empty
Data Transfer Element 1:Empty
Data Transfer Element 2:Empty
Data Transfer Element 3:Empty
Data Transfer Element 4:Empty
      Storage Element 1:Empty:VolumeTag=                                   
      Storage Element 2:Empty:VolumeTag=                                   
      Storage Element 3:Empty:VolumeTag=                                   
      Storage Element 4:Empty:VolumeTag=                                   
      Storage Element 5:Empty:VolumeTag=                                   
      Storage Element 6:Empty:VolumeTag=                                   
      Storage Element 7:Full :VolumeTag=N01038L7
      Storage Element 8:Empty:VolumeTag=                                   
      Storage Element 9:Empty:VolumeTag=                                   
      Storage Element 10:Empty:VolumeTag=                                   
      Storage Element 11:Empty:VolumeTag=                                   
      Storage Element 12:Empty:VolumeTag=                                   
      Storage Element 13:Empty:VolumeTag=                                   
      Storage Element 14:Empty:VolumeTag=                                   
      Storage Element 15:Empty:VolumeTag=                                   
      Storage Element 16:Empty:VolumeTag=                                   
      Storage Element 17:Empty:VolumeTag=                                   
      Storage Element 18:Empty:VolumeTag=                                   
      Storage Element 19:Empty:VolumeTag=                                   
      Storage Element 20:Empty:VolumeTag=                                   
      Storage Element 21:Empty:VolumeTag=                                   
      Storage Element 22:Empty:VolumeTag=                                   
      Storage Element 23:Full :VolumeTag=P0025SL7
      Storage Element 24:Empty:VolumeTag=                                   
      Storage Element 25:Empty:VolumeTag=                                   
      Storage Element 26:Empty:VolumeTag=

i will file a bug.