Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

LoadPackageAsync always fails if file string not correctly formated

I was looking into loading asset elements using LoadPackageAsync and get it crashed every time I passed a filename even if this file exists. If I read the log file I have the corresponding massage : "LoadPackageAsync failed to begin to load a package because the supplied package name was neither a valid long package name nor a filename of a map within a content folder: ' '".

When I investigating why this problem happens, I think I discover where the problem comes from. In the file AsyncLoading.cpp, in the function int32 LoadPackageAsync(const FString& InName, const FGuid* InGuid /*= nullptr*/, const TCHAR* InPackageToLoadFrom /*= nullptr*/, FLoadPackageAsyncDelegate InCompletionDelegate /*= FLoadPackageAsyncDelegate()*/, EPackageFlags InPackageFlags /*= PKG_None*/, int32 InPIEInstanceID /*= INDEX_NONE*/, uint32 InPackagePriority /*= 0*/) the line if (!(FPackageName::IsPackageFilename(InName) && FPackageName::TryConvertFilenameToLongPackageName(PackageName, PackageName))) always failed because PackageName is never initialised and this error will never recover. I don't know if this is actually the right behaviour but its strange to make some test that always fails.

I set up a workaround so it don't have to call the previous test.

Product Version: UE 4.10
more ▼

asked Mar 16 '16 at 10:19 AM in Bug Reports

avatar image

21 1 2 3

avatar image Doug E ♦♦ STAFF Mar 17 '16 at 01:41 PM

Hey RouxNicolas-

Could you provide the callstack and log files from the crash? This may involve causing the crash to occur again to generate the necessary files. Additionally, would it be possible to provide a small sample project with this issue and/or list the steps that lead to the crash so that I can test on my machine?

avatar image RouxNicolas Mar 18 '16 at 09:54 AM

As request you will find attach the appcrash and a simple test project. In addition you have to add a package obtained when you package the project in the directory /content/pak/ to make it work. It do not matter what is in the package.

avatar image RouxNicolas Mar 18 '16 at 10:03 AM

Forgot to save Test levelbefore sending it. It only contains a Myimportpakfile actor. To make it run/crashe, once it is started, only press the num 2 key.

testlevel.zip (2.1 kB)
avatar image Doug E ♦♦ STAFF Mar 23 '16 at 06:56 PM

Hey RouxNicolas-

When I open the project and press 2 there is an error that the file ExternalContent.pak does not exists. When I opened the Pak folder I noticed it was empty. Is there a file I need to create/add to the Pak folder? If it's possible to reproduce the crash in a new project, can you list the steps that cause the crash to occur?

avatar image RouxNicolas Mar 24 '16 at 01:45 PM

The ExternalContent is the package obtained when cooking the game or running UnrealPak.exe. As it is too big I can't attach it to the response. To change pak name or location you can make it in AImportPakFile::RunLoad().

avatar image antsonthetree Mar 25 '16 at 01:12 AM

Just wanted to chime in. I am having a similar issue with the 4.11 p8. Nicholas can you post details on your workaround? I am a little lost where to go next.

avatar image RouxNicolas Mar 25 '16 at 09:31 AM

The problem (for me) was that the test FPackageName::IsValidLongPackageName() always fail because the file has format that is incompatbible ( ex(" ../../../../../../Users/[UserName]/Documents/Unreal Projects/[ProjectName]/Content/Floor_400x400.uasset), because it contains '.' and the path isn't one of the path the engine is looking for. So to solve it I add this line of code before calling the RequestAsyncLoad of the streamable manage :

 if(AssetName.RemoveFromStart("../../../../../../Users/[UserName]/Documents/Unreal Projects/[ProjectName]/Content"))
     if (AssetName.RemoveFromEnd(".uasset"))
         FString Name = AssetName;
         StreamedAssets.Add("/Game" + AssetN ame);

if the UnrealProject directory is in your document directory. [ProjectName] is the name of your project.
If you are looking for engine file replace ../../../../../../Users/[UserName]/Documents/Unreal Projects/[ProjectName]/Content with ../../../Engine/Content/StreamProject/Content and "/Game" by "/Engine". Hope it helps

avatar image Doug E ♦♦ STAFF Apr 11 '16 at 07:24 PM

Hey RouxNicolas-

I apologize for the delayed response and I'm glad you were able to find a solution to the issue. Unfortunately I am not familiar with using LoadPackageAsync and have not been able to setup a reproduction case for investigation. You supplied a sample project when I found does not package successfully but I don't believe this is what you're referring to. Can you provide any further information that would help me understand exactly what you're attempting to do and what is failing for you?

avatar image RouxNicolas Apr 12 '16 at 08:19 AM

Indeed there is a problem when packaging a file. If you want to create from a new project here is the step :

  • Create a new c++ project. ;

  • Import code from AssetStreamer, ImportPakFile and Singleton";link text

  • In the Project.Build.cs add in public dependency the string "PakFile", "StreamingFile";link text

  • In the project settings>General settings seleect the Singleton class for Game Singleton Class;

  • Create a blueprint class from the ImportPakFile and place the actor in the world;

  • Create a package and move it to your project directory/Paks/ExternalContent (path to create) [Optoinally] To change the loading path, you need to change it in the ImportPakFile in the function RunLoad(). It should take each package in the directory.

  • To run the crash you have to run th RunLoad() function

You will find attached the c++ and cs file defined (there are the same as in the testlevel.zip

I try to load a dynamically a 3D object. The problem is that I can't load in game FBX file and because the file loaded are numerous and very big. In addition as the game will evolve in time, we don't want to repackage each time the game, we choose to load the package file generated by the UnrealPak.exe. Maybe there is another solution but I am not aware of this.

file.zip (5.6 kB)
avatar image Matthew J Apr 12 '16 at 07:48 PM

Hello RouxNicolas,

I was able to reproduce the crash that you're getting, but I wanted to try to clarify some things before reporting this issue, so that I'm sure that we have the correct information.

From reading over the previous comments, it seems as though your issue was that the output from FPackageName::IsValidLongPackageName() is not able to be used with RequestAsyncLoad due to the format that it's in. Trying to do this results in this crash, correct? If I've missed anything, please let me know and I'll add it to the report. Thank you for your cooperation in this matter as well.

avatar image RouxNicolas Apr 13 '16 at 02:17 PM

Hello Matthew Clark,

Maybe I misunderstand your reply but the function FPackageName::IsValidLongPackageName() itself won't crash. As it is use for testing the package name, if the function return false, a second set of test will be done. It they also fails then there is a call to a UE_LOG(Fatal) which crash the game. The reason the test fails are due to the filename is empty. That's why I sugest to remove the first "../.." in my answer

avatar image Matthew J Apr 13 '16 at 02:38 PM

Thank you for that clarification, but I'm not quite sure I understand what you mean. If you're removing that section, yet the "filename is empty" then what are you removing it from? Also, is this string (I.E. ../../../../../../Users/[UserName]/Documents/Unreal Projects/[ProjectName]/Content) hardcoded or something that you're getting returned from a function? Is it that passing a string such as that into the RequestAsyncLoad function ultimately initiates the crash?

avatar image RouxNicolas Apr 14 '16 at 07:53 AM

The program goal is to load elements contained from a pakage generated by Unreal Engine. After mounting it I look for the files containing it and try, if it is a uasset, to load it (function FAssetStreamer::StreamPackage). The uasset name and path is given when I call the function on IterateDirectoryRecursively (function FindAllPakFiles). Dependgin on the the mounting path the path may be different but in my case it is something like ../../../../../../Users/[UserName]/Documents/Unreal Projects/[ProjectName]/Content. When I call StreamableManager::RequestAsyncLoad with this path the program crash and when I investigate further I get a empty string before calling FPackageName::IsValidLongPackageName(). That is why I suggest to remove ../.. because without it I get a valid package name and no crash

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Thank you for the help understanding your issue, RouxNicolas. I've placed a bug in for the issue under the bug number UE-29849. I'll be tracking it and I'll let you know whenever there are any updates to the issue or if we need any more information from you.

Have a nice day!

more ▼

answered Apr 22 '16 at 09:29 PM

avatar image burak.io Sep 01 '16 at 10:46 AM

I have tested this on 4.13 Preview 3, it seems like it has not been solved yet. But JIRA says that it is solved https://issues.unrealengine.com/issue/UE-29849

avatar image Matthew J Sep 01 '16 at 02:52 PM

Thank you for pointing that out BurakShamansoft,

There have been a lot of changelists between when I verified this fix and Preview 3 so I'm fairly sure it was fixed at the time but it does seem like it may be back. I forgot to mention on the public JIRA but the fix for this was only for valid paths. If the path is invalid, the editor will still crash. Can you ensure that the path you're using is valid?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users


more ▼

answered Apr 16 '16 at 09:20 AM

avatar image

1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

通常pak是很容易加载成功的,而异步读取资源是否成功取决于你读取的路径是否正确。把那些.../../../..全部删掉,之后就可以在资源注册表通过各种方法使用这些资源了。have good day :)

more ▼

answered Apr 16 '16 at 09:28 AM

avatar image

1 1 2

avatar image dongquan360 May 05 '16 at 01:51 AM

弄了两天终于把路径试对了,但是异步读取资源的时候提示 LogLinker:Warning: The file '../../../LoadTest/Content/Content/ArchVis/Textures/T_Wood_S.uasset' contains unrecognizable data, check that it is of the expected type. 难道是我pak文件打包设置有问题

avatar image sonica1987 May 05 '16 at 02:11 AM

请把你的代码贴上来,通常PAK打包是否成功是可以检查的,在控制台输入命令使用UnrealPak.exe进行检查:cd C:\Program Files\Epic Games\4.9\Engine\Binaries\Win64 UnrealPak.exe C:\New2.pak -List pause 查看名称是否正确。 按照我的经验你的问题并不只是路径的问题

avatar image sonica1987 May 05 '16 at 02:13 AM


avatar image dongquan360 Sep 09 '16 at 07:39 AM

名称和路径应该都没问题,肯定也是COOK了的,打包DLC的方法就是按照官方文档来做的,下面链接是我写的测试代码,麻烦帮忙看看 https://answers.unrealengine.com/storage/temp/90237-loadtest.zip

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question