Commit 77e0ea10 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

fix

parent fc9a4516
Loading
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -152,7 +152,10 @@ def refresh_docx_fields(input_path: str, image: str = "docx-field-refresh") -> s
    mount_point_container = "/data"
    file_path_in_container = f"{mount_point_container}/{input_path.relative_to(mount_point_host)}"
    
    print(f"📂 Mount point (host): {mount_point_host}")
    # Convert Path to string for Docker commands
    mount_point_host_str = str(mount_point_host)
    
    print(f"📂 Mount point (host): {mount_point_host_str}")
    print(f"📂 Mount point (container): {mount_point_container}")
    print(f"📂 File path in container: {file_path_in_container}")
    
@@ -179,7 +182,7 @@ def refresh_docx_fields(input_path: str, image: str = "docx-field-refresh") -> s
    
    cmd = [
        "docker", "run", "--rm",
        "-v", f"{mount_point_host}:{mount_point_container}",
        "-v", f"{mount_point_host_str}:{mount_point_container}",
        "-e", f"HOME={mount_point_container}",
        "--entrypoint", "/bin/bash",
        image,
@@ -190,17 +193,18 @@ def refresh_docx_fields(input_path: str, image: str = "docx-field-refresh") -> s
    
    # Run diagnostic commands on the host
    print(f"🔍 Running diagnostic commands on HOST...")
    host_diag_cmd = f"ls -la {mount_point_host} && pwd && whoami && echo 'Mount point contents:' && ls -la {mount_point_host}/baseline/ 2>/dev/null || echo 'No baseline directory'"
    host_diag_cmd = f"ls -la {mount_point_host_str} && pwd && whoami && echo 'Mount point contents:' && ls -la {mount_point_host_str}/baseline/ 2>/dev/null || echo 'No baseline directory'"
    subprocess.run(host_diag_cmd, shell=True, check=False)  # Don't fail if diagnostic fails
    
    # Run diagnostic commands in the container
    print(f"🔍 Running diagnostic commands in CONTAINER...")
    print(f"🔍 Mount: {mount_point_host_str} -> {mount_point_container}")
    diag_cmd = [
        "docker", "run", "--rm",
        "-v", f"{mount_point_host}:{mount_point_container}",
        "-v", f"{mount_point_host_str}:{mount_point_container}",
        "--entrypoint", "/bin/bash",
        image,
        "-c", f"echo '=== Container Diagnostics ===' && pwd && whoami && echo '=== /data contents ===' && ls -la {mount_point_container} && echo '=== /data/baseline contents ===' && ls -la {mount_point_container}/baseline/ 2>/dev/null || echo 'No baseline directory' && echo '=== Checking if file exists ===' && ls -la {file_path_in_container} 2>/dev/null || echo 'File not found: {file_path_in_container}'",
        "-c", f"echo '=== Container Diagnostics ===' && echo 'Mount point: {mount_point_container}' && pwd && whoami && echo '=== /data contents ===' && ls -la {mount_point_container} && echo '=== Checking mount ===' && test -f {file_path_in_container} && echo 'File exists in container!' || echo 'File NOT found in container' && echo '=== /data/baseline contents ===' && ls -la {mount_point_container}/baseline/ 2>/dev/null || echo 'No baseline directory' && echo '=== Checking if file exists in container ===' && ls -la {file_path_in_container} 2>/dev/null || echo 'File not found: {file_path_in_container}'",
    ]
    subprocess.run(diag_cmd, check=False)  # Don't fail if diagnostic fails