[Solved] File not found update.pem

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3779
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

[Solved] File not found update.pem

#1 Post by Imperf3kt »

I recently updated Ren'Py to 8.2.0.25012702 and tried to build an Android version of my project (universal apk) but upon building the package, I am met with the following error

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/android.rpy", line 539, in <module>
  File "game/android.rpy", line 223, in android_build
  File "game/distribute.rpy", line 591, in __init__
  File "game/distribute.rpy", line 1700, in make_key_pem
FileNotFoundError: [Errno 2] No such file or directory: 'F:\\renpy\\GGD Mentor\\update.pem'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "launcher/game/front_page.rpyc", line 246, in script call
  File "launcher/game/android.rpyc", line 539, in script
  File "C:\Program Files (x86)\renpy\renpy\ast.py", line 823, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Program Files (x86)\renpy\renpy\python.py", line 1178, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/android.rpy", line 539, in <module>
  File "game/android.rpy", line 223, in android_build
  File "game/distribute.rpy", line 591, in __init__
  File "game/distribute.rpy", line 1700, in make_key_pem
FileNotFoundError: [Errno 2] No such file or directory: 'F:\\renpy\\GGD Mentor\\update.pem'

Windows-10-10.0.19045 AMD64
Ren'Py 8.2.0.24012702
Ren'Py Launcher 8.2.0.24012702
Tue Feb 13 00:12:42 2024
I don't know when this first started but I know it worked fine at least as recently as 8.1.3.23091805

Does anybody know what I need to do to fix this?


I just checked the Android SDK and I might need to download a new version of the JDK. I believe I am using Java 8 still and Ren'Py is telling me I should have JDK21. That might be my issue
Last edited by Imperf3kt on Wed Feb 28, 2024 7:06 am, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
m_from_space
Miko-Class Veteran
Posts: 895
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: File not found update.pem

#2 Post by m_from_space »

Imperf3kt wrote: Mon Feb 12, 2024 9:15 amI believe I am using Java 8 still and Ren'Py is telling me I should have JDK21. That might be my issue
I mean, Java 8 is from 2014. Man... :lol: How about trying that first?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3779
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: File not found update.pem

#3 Post by Imperf3kt »

m_from_space wrote: Tue Feb 13, 2024 6:16 am
Imperf3kt wrote: Mon Feb 12, 2024 9:15 amI believe I am using Java 8 still and Ren'Py is telling me I should have JDK21. That might be my issue
I mean, Java 8 is from 2014. Man... :lol: How about trying that first?
I made the thread before considering that may be the issue.
I'll update when I get a chance to try.

For what it's worth, ren'py was working fine exporting Android builds all the way up to 8.1 using JDK 8 and I believe was necessary for it to work unless I am mistaken
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3779
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: File not found update.pem

#4 Post by Imperf3kt »

Today I got around to installing the correct JDK. I clicked "Install SDK" and it says "It looks like you're ready to start packaging games." so I started trying to build a universal APK which appeared to work fine, at first, but it still fails with the same error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/android.rpy", line 539, in <module>
  File "game/android.rpy", line 223, in android_build
  File "game/distribute.rpy", line 591, in __init__
  File "game/distribute.rpy", line 1700, in make_key_pem
FileNotFoundError: [Errno 2] No such file or directory: 'F:\\renpy\\GGD Mentor\\update.pem'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "launcher/game/front_page.rpyc", line 246, in script call
  File "launcher/game/android.rpyc", line 539, in script
  File "C:\Program Files (x86)\renpy\renpy\ast.py", line 823, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Program Files (x86)\renpy\renpy\python.py", line 1178, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/android.rpy", line 539, in <module>
  File "game/android.rpy", line 223, in android_build
  File "game/distribute.rpy", line 591, in __init__
  File "game/distribute.rpy", line 1700, in make_key_pem
FileNotFoundError: [Errno 2] No such file or directory: 'F:\\renpy\\GGD Mentor\\update.pem'

Windows-10-10.0.19045 AMD64
Ren'Py 8.2.0.24012702
Ren'Py Launcher 8.2.0.24012702
Fri Feb 16 15:00:49 2024
I don't know anything about the error to even begin troubleshooting
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3779
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: File not found update.pem

#5 Post by Imperf3kt »

I have checked other, older projects, and they build an android distribution just fine, so I am completely confused what is happening with this project.
The project in question is considerably larger and more complex than the others I built, but I haven't changed anything significant since last releasing an update, so I don't know the first thing to troubleshoot.

I will just restart the project from scratch, copying it over piece by piece until I have rebuilt the entire thing. I really don't want to do that, but I have no idea how else to fix whatever is wrong with it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

jeffster
Veteran
Posts: 278
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: File not found update.pem

#6 Post by jeffster »

All I can say is that

PEM is a container file format often used to store cryptographic keys.

Like those used for SSL certificates (for "https" web connections).

The error must have something to do with a failure to acquire or use some Android key or something.
Is it a Ren'Py bug or some change in Android /store data - no idea, but maybe dig in that direction.

downover
Newbie
Posts: 21
Joined: Sun Feb 25, 2024 1:36 am
Contact:

Re: File not found update.pem

#7 Post by downover »

I also ran into this. I think it probably only happens when you have "Build Updates" checked. I can't find any code in renpy to generate it, but something did in one of my projects, so I just copied it into my other project so it could be used there as well. I'm just testing stuff at this point, not releasing anything.

It's used to build updates.ecdsa, which is used to sign builds so that they can be verified by the updater. See https://www.renpy.org/doc/html/updater.html. There's not much documentation about it, but it does say that it can usually be safely ignored, which doesn't seem to be the case :).

According to this there should be one in renpy base so maybe you can just copy that one. But again, I would only do that for test projects - if you're going to distribute this you should probably make an update.pem unique to your project and store it securely!

Code: Select all

        def find_update_pem(self):
            if self.build['renpy']:
                return os.path.join(config.renpy_base, "update.pem")
            else:
                return os.path.join(self.project.path, "update.pem")

downover
Newbie
Posts: 21
Joined: Sun Feb 25, 2024 1:36 am
Contact:

Re: File not found update.pem

#8 Post by downover »

Oh, here is where it's generated. It should happen as part of the Distribute flow.

distribute_gui.rpy:

Code: Select all

label start_distribute:
    if project.current.dump["build"]["include_update"] and not os.path.exists(os.path.join(project.current.path, "update.pem")):
        call add_update_pem
Looks like it's just generating one randomly. So if you can't find out how to get renpy to create it, you could just use this snippet to create one in python. Substitute your project's path, of course.

Code: Select all

        import ecdsa
        key = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p).to_pem()

        with open(os.path.join(project.current.path, "update.pem"), "wb") as f:
            f.write(key)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3779
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: File not found update.pem

#9 Post by Imperf3kt »

Thanks for the tips.
I was going into android.rpy looking for any references I could, but I never thought to check distribute_gui
jeffster wrote: Tue Feb 27, 2024 7:35 am All I can say is that

PEM is a container file format often used to store cryptographic keys.

Like those used for SSL certificates (for "https" web connections).

The error must have something to do with a failure to acquire or use some Android key or something.
Is it a Ren'Py bug or some change in Android /store data - no idea, but maybe dig in that direction.
I'm going to assume it's an error on my end, I just need to figure out exactly what, but I have a couple of leads now.
Thanks everyone
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3779
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: File not found update.pem

#10 Post by Imperf3kt »

downover wrote: Wed Feb 28, 2024 1:06 am I also ran into this. I think it probably only happens when you have "Build Updates" checked. I can't find any code in renpy to generate it, but something did in one of my projects, so I just copied it into my other project so it could be used there as well. I'm just testing stuff at this point, not releasing anything.

It's used to build updates.ecdsa, which is used to sign builds so that they can be verified by the updater. See https://www.renpy.org/doc/html/updater.html. There's not much documentation about it, but it does say that it can usually be safely ignored, which doesn't seem to be the case :).

According to this there should be one in renpy base so maybe you can just copy that one. But again, I would only do that for test projects - if you're going to distribute this you should probably make an update.pem unique to your project and store it securely!

Code: Select all

        def find_update_pem(self):
            if self.build['renpy']:
                return os.path.join(config.renpy_base, "update.pem")
            else:
                return os.path.join(self.project.path, "update.pem")
This seems to have been the issue. Thank you so much for finding this and the suggested fix
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

schaakakon
Newbie
Posts: 1
Joined: Thu Feb 29, 2024 5:20 pm
Contact:

Re: File not found update.pem

#11 Post by schaakakon »

Imperf3kt wrote: Wed Feb 28, 2024 7:06 am
downover wrote: Wed Feb 28, 2024 1:06 am I also ran into this. I think it probably only happens when you have "Build Updates" checked. I can't find any code in renpy to generate it, but something did in one of my projects, so I just copied it into my other project so it could be used there as well. I'm just testing stuff at this point, not releasing anything.

It's used to build updates.ecdsa, which is used to sign builds so that they can be verified by the updater. See https://www.renpy.org/doc/html/updater.html. There's not much documentation about it, but it does say that it can usually be safely ignored, which doesn't seem to be the case :).

According to this there should be one in renpy base so maybe you can just copy that one. But again, I would only do that for test projects - if you're going to distribute this you should probably make an update.pem unique to your project and store it securely!

Code: Select all

        def find_update_pem(self):
            if self.build['renpy']:
                return os.path.join(config.renpy_base, "update.pem")
            else:
                return os.path.join(self.project.path, "update.pem")
This seems to have been the issue. Thank you so much for finding this and the suggested fix
I'm having this exact same issue. Looks like the solution worked for you but I'm not skilled enough at Renpy to understand how to use the solution. What is it that solved this update.pem file not found issue for you?

Post Reply

Who is online

Users browsing this forum: Google [Bot]