Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-70354

File Path on WiredTiger Error with Trailing Slash on dbPath

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • Fully Compatible
    • Execution EMEA Team 2023-10-16, Execution EMEA Team 2023-10-30
    • 35

      If a database file does not exist, accidentally deleted say, we show an error similar to the following:

      2022-10-07T15:50:41.841+0100 E  STORAGE  [conn11] WiredTiger error (2) [1665154241:841014][22344:0x70000ca25000], file:test/collection-19-1350638838509104517.wt, WT_SESSION.open_cursor: __posix_open_file, 667: /Users/ronan.merrick/test/data/rs1/db//test/collection-19-1350638838509104517.wt: handle-open: open: No such file or directory Raw: [1665154241:841014][22344:0x70000ca25000], file:test/collection-19-1350638838509104517.wt, WT_SESSION.open_cursor: __posix_open_file, 667: /Users/ronan.merrick/test/data/rs1/db//test/collection-19-1350638838509104517.wt: handle-open: open: No such file or directory
      

      In this case my dbPath was /Users/ronan.merrick/test/data/rs1/db/ and I was using directoryPerDB. The error message says the the file /Users/ronan.merrick/test/data/rs1/db//test/collection-19-1350638838509104517.wt could not be found.

      Note the double-slash between the dbPath and the db folder for the file:

      /Users/ronan.merrick/test/data/rs1/db//test/collection-19-1350638838509104517.wt 
      

      If there is no trailing slash in dbPath the double slash isn't present in the file path in the log message

      2022-10-07T16:20:10.863+0100 E  STORAGE  [conn9] WiredTiger error (2) [1665156010:863900][25320:0x70000c54f000], file:collection-23--6489519673391634808.wt, WT_SESSION.open_cursor: __posix_open_file, 667: /Users/ronan.merrick/test/data/rs1/db/collection-23--6489519673391634808.wt: handle-open: open: No such file or directory Raw: [1665156010:863900][25320:0x70000c54f000], file:collection-23--6489519673391634808.wt, WT_SESSION.open_cursor: __posix_open_file, 667: /Users/ronan.merrick/test/data/rs1/db/collection-23--6489519673391634808.wt: handle-open: open: No such file or directory
      

      I think it would be better if we removed the double-slash if there is a trailing slash on dbPath. It can be misleading and can make you think there is an issue with an incorrect path

      I came across this on a case with v4.2, but it appears to be the same in v6.0:

      {"t":{"$date":"2022-10-07T16:34:39.058+01:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"conn9","msg":"WiredTiger error message","attr":{"error":2,"message":{"ts_sec":1665156879,"ts_usec":58281,"thread":"26578:0x700004568000","session_name":"WT_SESSION.open_cursor","category":"WT_VERB_DEFAULT","category_id":9,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"int __posix_fs_size(WT_FILE_SYSTEM *, WT_SESSION *, const char *, wt_off_t *):296:/Users/ronan.merrick/test/data/rs1/db//collection-38--834835323716624355.wt: file-size: stat","error_str":"No such file or directory","error_code":2}}}
      

            Assignee:
            david.dominguez@mongodb.com David Dominguez Sal (Inactive)
            Reporter:
            ronan.merrick@mongodb.com Ronan Merrick
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: