Page MenuHome

BAM using original lib path instead of remaped path
Closed, ResolvedPublic

Description

When checkout:

bam checkout pro/escena/0770_cartel_aeropuerto/0770_010_cartel_aeropuerto/0770_010_cartel_aeropuerto.blend

File not found error is raised:

FileNotFoundError: [Errno 2] No such file or directory: '0770_010_cartel_aeropuerto/../../../interactivo/auto_generico_04.blend'

Since bam_cli.py is attempting to edit this file:

0770_010_cartel_aeropuerto/../../../personaje/extra_casual_mujer_v01.blend

Just concatenating the session root dir 0770_010_cartel_aeropuerto with the original lib path ../../../personaje/extra_casual_mujer_v01.blend
Instead of concatenating the session root dir 0770_010_cartel_aeropuerto with the remaped path //_pro/personaje/extra_casual_mujer_v01.blend

0770_010_cartel_aeropuerto/_pro/personaje/extra_casual_mujer_v01.blend

Event Timeline

Gabriel Caraballo (eibriel) created this task.
Gabriel Caraballo (eibriel) renamed this task from BAM using to BAM using original lib path instead of remaped path.
Gabriel Caraballo (eibriel) claimed this task.
Gabriel Caraballo (eibriel) raised the priority of this task from to Needs Triage by Developer.

Complete error:

Traceback (most recent call last):
  File "/bin/bam", line 8, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 1886, in main
    args.func(args)
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 1542, in <lambda>
    bam_commands.checkout(args.path, args.output, args.all_deps),
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 780, in checkout
    bam_session.binary_edits_apply_all(session_rootdir, paths=None, update_uuid=True)
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 375, in binary_edits_apply_all
    paths_uuid_update,
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 324, in binary_edits_apply_single
    with open(blendfile_abs, 'rb+') as fh_blend:
FileNotFoundError: [Errno 2] No such file or directory: '0770_010_cartel_aeropuerto/../../../interactivo/auto_generico_04.blend'

Added Test on commit rBAM12d0293a990079abdfac4724996c27bee6c3fcb3

Whit error:

E
======================================================================
ERROR: test_absolute_relative_from_blendfiles_missing_texture (test_cli.BamRelativeAbsoluteTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiribati/dev/BAM/blender-asset-manager/tests/test_cli.py", line 1629, in test_absolute_relative_from_blendfiles_missing_texture
    stdout, stderr = bam_run(["checkout", blendfile, "--output", session_path], proj_path)
  File "/home/kiribati/dev/BAM/blender-asset-manager/tests/test_cli.py", line 250, in bam_run
    bam.cli.main(argv)
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 1883, in main
    args.func(args)
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 1539, in <lambda>
    bam_commands.checkout(args.path, args.output, args.all_deps),
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 777, in checkout
    bam_session.binary_edits_apply_all(session_rootdir, paths=None, update_uuid=True)
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 372, in binary_edits_apply_all
    paths_uuid_update,
  File "/home/kiribati/dev/BAM/blender-asset-manager/bam/cli.py", line 324, in binary_edits_apply_single
    with open(blendfile_abs, 'rb+') as fh_blend:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/bam_test/local_store/test_project/mysession/../../../level1_lib/level1_lib.blend'

----------------------------------------------------------------------
Ran 1 test in 2.031s

FAILED (errors=1)

bam_deps_remap.json when failing:

{
    "level1_lib.blend": {
        "//../../_root/level1_lib/level2_lib/texture.png": "//level2_lib/texture.png"
    },
    "level3.blend": {
        "//_root/level1_lib/level1_lib.blend": "//../../../level1_lib/level1_lib.blend"
    }
}

//../../../level1_lib/level1_lib.blend is wrong

Adding bam status to test on commit rBAM75bb629 , Now is reporting modified and deleted files, which is wrong:

M: _root/level1_lib/level1_lib.blend
D: ../../../level1_lib/level1_lib.blend

What's the status here? Did your fix resolved the issue?

It also worth reporting another report even if the fix to the original report broke something.

Yes, is fixed, should I merge it on master and close the report?

It also worth reporting another report even if the fix to the original report broke something.

Ok! ^

Looked into this and having compressed files locally - which need to be uncompressed to make a few edits - then recompress,

Its going to slow down local operations too much.

Instead, on the server side, bam can just not compress the files in the first place.
The packer can ensure all files are uncompressed before sending.