Attachment Base URIs 2024.2

Has anyone else noticed an issue with base URIs on 2024.2 I can correlate the issue to starting after our upgrade from 2023.2 to 2024.2.

What we are seeing is a truncated Base URI in both companies, but the it’s only giving us the end of it not the start of it. It is also correct in the database, but it is not correct in new attachments or the attachment type screen.

This is what the values show in the database the two are for each company record.

Note that in the actual attachment tables it’s cut short to starting with “cor Documents” in one company and “cuments” in the other.

This is reflected in the actual screens even though it’s not stored in the database that way either!

I can even try to change it to anything else and it goes sideways.
GIF

Notice it’s stored as I pasted in the DB, but it won’t be correct on new attachments.

3 Likes

Does it do the same for other storage types? (Link, SharePoint, DocStar, etc?)

Don’t know don’t use any of them. It seems to work if I don’t give it a UNC path The documents haven’t uploaded either, likely because it’s not a valid path. No errors in the Event Viewer for this issue. I just saw one come through so I can confirm that in the event viewer.

Looks like it’s UNC path breaking it. If I give it a shared drive letter path it’s fine with that. But where it is breaking seems so random. It must be something with the slashes?

1 Like

Can confirm it’s working great in my 2023.2 development system, but is also broken in our 2024.2 testing system.

This is the path working fine from our 2023.2 dev system. Works the same in browser version as well.

1 Like

Also updated the paths in our system and it took and displays right in the screen but it’s trying to use the old path yet on my new uploads.

1 Like

Everyone might want to check their attachments, you may not have noticed it because the user attaches something and doesnt try to open their new attachments.

Its related to Ice.Services.BO.DmsStorageType RemoveServerPathFromFileStorage

2 Likes

They arbitrarily cut your BaseURI front half off based on the length of your server directory. I.E. if your server directory is "C:\EpicorData\OurData" that length is what is removed from the beginning of your BaseURI. So if your baseURI is “\myserver\myappserver\some\folder\structure” cut the first 22 characters off of that… the length of "C:\EpicorData\OurData"…

Reported in case CS0004680571 issue confirmed by another customer that this is as of 2024.2 and that 2024.1 seems ok.

To Jose and I… this sounds like the work of ChatGPT getting confused about what was actually supposed to be done…

8 Likes

I have also been fighting this in my testing of 2024.1.17 over the last few days. I copy and paste in my URI, save, and close. I open it back up, and I get NTS as the base URI. If it is some shortcut, I have to find out where it might be going. As long as I use a document type when setting the attachment, it goes to the correct place shown in Doc Type Maint.
Scott

1 Like

This falls under PRB0283869 fixed in 2025.1 or ICE 5.0.100

3 Likes

Uh, that’s a major flaw, I think they need to rethink that.

1 Like

As a workaround try the following.

  1. Paste your BaseURI in as exactly as you want it. We’ll use "\myserver.domain.local\something\nice" as an example.
  2. If you save the BaseURI and it gets cut off to say "mething\nice" then put this in the field "\myserver.domain.local\so\myserver.domain.local\something\nice"

It should truncate to the actual BaseURI you want. Restart client (it appears that URL may get client cached) and try again.

If the whole thing is disappearing you then have to figure out how much you need to pad in to make it show up. You might have to do something like "\path\path\path\pa\myserver.domain.local\something\nice" to get it to work because your Company Data Directory is longer than your BaseURI.

Also this needs to be done in the browser because it does not validate the client path and the Smart Client does so if you gave the Smart Client "\path\path\path\pa\myserver.domain.local\something\nice" it’s going to say sorry bruh that’s not a valid path.

4 Likes

On it.

7 Likes

I must be too tired after this. Terrible time to stop drinking.
I will try in the morning.
I attempted this, but I keep getting an attachment in C:\Epicor\ERP11\LocalClients\Kinetic******************

This C:\ keeps getting pushed in front of what I try to fake it out with.
Scott

2 Likes

Heh that was my first thought when I saw this earlier. Every time I’ve seen this in the wild it’s been the outcome of someone pawing through the URI with character indexes instead of using the URI function or type or object that seems to be baked into everything nowadays. Lose track of which int is which and apply the wrong one, and you get an error matching the length of some other subset of the URI.

2 Likes

Fixed in 2024.2.8 per PRB0283869. Thank’s @pferrington for taking this one on and getting it licked!

We found the attachments that went to “nowhere” they were on the client computers in the client folders because it was using a relative path.

image

Ran this script in PDQDeploy against all client PCs to generate a report on which clients had the files and then copy pasted them back to our base URI.

if ((Test-Path "C:\Epicor\ProductionClient\Client\cuments") -or 
    (Test-Path "C:\Epicor\ProductionClient\Client\cor Documents")) {
    exit 1
} else {
    exit 0
}

Then ran this SQL to fix the attachment paths

UPDATE Ice.XFileRef SET XFileName = CONCAT('\\server.domain.local\company1\Epicor Do', XFileName) WHERE XFileName LIKE 'cuments\%'
UPDATE Ice.XFileRef SET XFileName = CONCAT('\\server2.domain2.local\company2\Epi', XFileName) WHERE XFileName LIKE 'cor Documents\%'

Generated a list of all the attachments attached since we upgraded 11/27

SELECT XFileName FROM Ice.XFileRef WHERE XFileRefNum >= 194910 AND DocTypeID = '' ORDER BY XFileRefNum DESC

Then ran this powershell script against that file to ensure all files existed where they should

# Path to the input TXT file
$InputFile = "C:\TEMP\fileSearch.txt"

# Check if the file exists
if (!(Test-Path -Path $InputFile)) {
    Write-Host "Input file not found: $InputFile" -ForegroundColor Red
    exit 1
}

# Read all lines from the input file
$filePaths = Get-Content -Path $InputFile

# Initialize an array for missing files
$missingFiles = @()

# Loop through each file path
foreach ($filePath in $filePaths) {
    if (!(Test-Path -Path $filePath)) {
        # Add missing file path to the array
        $missingFiles += $filePath
    }
}

# Output missing files
if ($missingFiles.Count -eq 0) {
    Write-Host "All files exist." -ForegroundColor Green
} else {
    Write-Host "The following files are missing:" -ForegroundColor Yellow
    $missingFiles | ForEach-Object { Write-Host $_ -ForegroundColor Red }
}
5 Likes

Well Done Reaction GIF

2 Likes