Skip to content

Inconsistent directories representing a device in file transfer service #4160

@rina23q

Description

@rina23q

Describe the bug
After config_snapshot and log_upload commands, the files to be uploaded to C8Y are kept under the directory named device.id (=TST_cut_customer_pot here).

On the other hand, config_update command creates a directory named device_main__. Actually device_main__/config_update directory seems empty. The actual file is kept under /cache.

main device

root@1528f2a83aa0:/var/tedge# tree
.
├── cache
│   └── 3ec19e892a5d6cd490155e60cee6d3a84140947447146f97fe4850ba5e684df1
├── file-transfer
│   ├── TST_cut_customer_pot
│   │   ├── config_snapshot
│   │   │   └── system.toml-c8y-mapper-446200
│   │   └── log_upload
│   │       └── all-units::journald-c8y-mapper-446209
│   └── device_main__
│       └── config_update
└── firmware

child device

The child device's entity registration message is this:

[te/device/TST_trim_light_kettle//] {"@parent":"device/main//","@type":"child-device","name":"TST_trim_light_kettle"}

The main device's /var/tedge:

root@1ce1f59272c3:/var/tedge# tree
.
├── cache
│   └── 036a3433583d65c95e5f9f31c06fc95f555f3862444fbd86ac33c2bc390c8b53
├── file-transfer
│   ├── TST_crush_yellow_arrangement:device:TST_trim_light_kettle
│   │   ├── config_snapshot
│   │   │   ├── :etc:tedge:tedge.toml-c8y-mapper-446214
│   │   │   ├── :etc:tedge:tedge.toml-c8y-mapper-446220
│   │   │   └── tedge-configuration-plugin-c8y-mapper-446222
│   │   └── log_upload
│   │       └── all-units::journald-c8y-mapper-446217
│   └── device_TST_trim_light_kettle__
│       └── config_update
│           └── tedge-configuration-plugin-c8y-mapper-446225 -> /var/tedge/cache/036a3433583d65c95e5f9f31c06fc95f555f3862444fbd86ac33c2bc390c8b53
└── firmware

Also, there are two directories, one is TST_crush_yellow_arrangement:device:TST_trim_light_kettle and the other one is
device_TST_trim_light_kettle__ for representing the same device.

To Reproduce
Run Configuration Snapshot, Configuration Update, and Log Upload operations from c8y and check the /var/tedge/file-transfer directory.

Expected behavior
The directory and file from config_update should also be kept under the directory with the device name (= TST_cut_customer_pot here)

Screenshots

Environment (please complete the following information):

  • OS [incl. version]
  • Hardware [incl. revision]
  • System-Architecture [e.g. result of "uname -a"]
  • thin-edge.io version 2.0.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions