Hi all, I have a problem using Perfoce with Unreal 4.27.2.
I have built Unreal from the github source for Ubuntu. All is working well development-wise, we are switching to Perforce for version control and when trying to connect I am met with the following error in the console.
P4ERROR: Failed to connect to source control provider.
SSL library must be at least version 1.0.1.
Port=ssl.xxxx:1666, User=xxxx, ClientSpec=, Ticket=
I have p4 installed on the PC and there are no issues connecting manually from the CLI:
âžś ~ export P4PORT=ssl:xxxx:1666
âžś ~ export P4USER=xxxx
âžś ~ p4 users
Perforce password (P4PASSWD) invalid or unset.
Attempting login for user 'xxxx' against server 'ssl:xxxx:1666'
Enter password: ********
User xxxx logged in.
xxxx <xxxx@org> (xxxx) accessed 2024/03/23
... etc
This issue is not present in the Windows build of 4.27.2 (working out-of-the-box) and, according to this post, SSL has been supported since version 4.8.
Switching to Windows or UE5 could mitigate this, but both of these options would be an inconvenience to the team. Would anyone be able to give suggestions for resolving this?
Hi, thanks for your quick response! I was having a look and just noticed that the version of OpenSSL in this dir is higher than the UE4 error message requests:
âžś OpenSSL pwd
/home/user/Downloads/UnrealEngine-4.27.2-release/Engine/Source/ThirdParty/OpenSSL
âžś OpenSSL ls -la
total 28
drwxrwxr-x 5 user user 4096 May 17 2023 .
drwxrwxr-x 104 user user 4096 Dec 7 2021 ..
drwxrwxr-x 4 user user 4096 May 17 2023 1.1.1c
drwxrwxr-x 4 user user 4096 May 17 2023 1.1.1k
-rw-rw-r-- 1 user user 3244 Dec 7 2021 OpenSSL.Build.cs
-rw-rw-r-- 1 user user 637 Dec 7 2021 OpenSSL.tps
drwxrwxr-x 2 user user 4096 May 17 2023 Patches
I have tried chmod -R 777 ./1.1.1c to check it’s not an access error, but I still have the same issue. Would you still recommend upgrading to a higher version of OpenSSL, e.g. 3.x ?
Inside the terminal I am launching UE4 from, I have an extra error message:
LogSourceControl: Error: P4ERROR: Invalid connection to server.
LogSourceControl: Error: Connect to server failed; check $P4PORT.
SSL library must be at least version 1.0.1.
It could be less about OpenSSL, and that the connection vars are not being read properly, though I can’t follow this logic since these vars are set inside of the game engine (below). It also doesn’t work with $P4PORT either set or unset inside of the terminal session.
So in 4.27.2 the linux part in Perforce.build.cs is
In Unreal 5 is …
so change the line Perforce/p4api-2014.1/ for the one in Unreal 5 and download that folder from a resent version of Unreal source , and check if compile.
I have tried the fix you mentioned: copying the library from UE5.3 and changing Perforce.build.cs.
Sadly the library was not compiled with just this fix, I think because the directory include was changed to Include in newer releases of the API. After this, I tried compiling again a few more times. Each time blindly changing a few more variables in the .cs file which seemed like they would matter but haven’t got it working. There is probably a bit of nuance to it, and I don’t have that knowledge .
Just looking for a way to point Unreal at the correct package so it’s compiled and then see if this is the fix.
âžś UE cp ../Commit.gitdeps.xml UnrealEngine-4.27.2-release/Engine/Build/Commit.gitdeps.xml
âžś UE cd UnrealEngine-4.27.2-release
âžś UnrealEngine-4.27.2-release ./Setup.sh
# ...
# Register unreal file types? (Y)
# ...
# No third party libs needed to be built locally
# ********** SUCCESS ****************
# Setup successful.
Then I can see the Library was not compiled:
âžś UE cd UnrealEngine-4.27.2-release/Engine/Source/ThirdParty/Perforce/p4api-2018.1
âžś p4api-2018.1 ls *
Include:
Linux Mac Win32 Win64
Lib:
Mac Win32 Win64
Hi again, thank you for the response. I have tried your newest suggestion + the code fix before, but it’s still not compiling the library on Linux. I tried running GenerateProjectFiles.sh but it’s showing the following:
/home/user/Downloads/UE/UnrealEngine-4.27.2-release/Engine/Source/ThirdParty/Perforce/Perforce.Build.cs: warning: Referenced directory '/home/user/Downloads/UE/UnrealEngine-4.27.2-release/Engine/Source/ThirdParty/Perforce/p4api-2018.1/include/Linux' does not exist.
Thank you again, your patience and support is incredible, but I may start looking towards UE5 to keep the project moving, instead of fixing a niche problem such as this.
If you still have suggestions though, if I’m able I will give them a go on Linux for the posterity of this article and see if we can find a fix
Then you are not copying the folder from UE5 correctly . Every time you run Setup.sh all files get overwrite .
When you download the Source you dont have all the files until you run Setup.sh. May be you copied just an empty folder from UE5.
Hey again, yes I ran Setup.sh before GenerateProjectFiles.sh, it was just to show that it’s not finding them after the fact.
I am not copying an empty folder from UE5. Do you perhaps mean I should compile UE5, and copy the compiled folder over? I can try but I don’t think that is reliable. Here is a picture from my terminal to show it’s not empty, with Mac dir for comparison:
Again, after compiling the Linux Lib is not present:
~ UE cp ./Commit.gitdeps.xml UnrealEngine-4.27.2-release/Engine/Build/Commit.gitdeps.xml
~ cd UnrealEngine-4.27.2-release
~ UnrealEngine-4.27.2-release ./Setup.sh
# ...
# No third party libs needed to be built locally
# ********** SUCCESS ****************
# Setup successful.
~ ls UnrealEngine-4.27.2-release/Engine/Source/ThirdParty/Perforce/p4api-2018.1/Lib
# Mac Win32 Win64
You are confuse thinking you will create the libs when you compile your engine, but that`s not the case. The libs should be already there before you start compiling.
When you run the UE5 setup.sh you should end up with 2 Folders inside “p4api-2018.1”.
One Include folder (the one you show me) and one Lib folder. Inside Lib folder you have 3 folder one for each platform , Win64, Linux, and Mac.
Those Libs inside Linux is what you need when you compile your engine, UnrealbuildTools will link your perforce binaries to those libs inside that folder.
I see you are only copying the Linux folder, you need to copy the whole “p4api-2018.1” folder.
Compiler is complaining because cant find the libs.
Thanks I am away for easter but will try this after. However those Lib files are not present until I already run Setup.sh, even on UE5:
âžś UE ls UnrealEngine-5.3.2-release/Engine/Source/ThirdParty/Perforce/p4api-2018.1
# Include
âžś cd UnrealEngine-5.3.2-release
âžś UnrealEngine-5.3.2-release ./Setup.sh
# ...
âžś UnrealEngine-5.3.2-release ls Engine/Source/ThirdParty/Perforce/p4api-2018.1
# Include Lib
Apologies I don’t know too much about compilers, does Setup.sh compile the engine? Or are the Lib files just generated by running Setup.sh, and then compiling happens at a later stage, so I can manually inject these Lib files without issues.