XF 2.2 Zip not created for Addon

chris p

Member
I was getting ready to export my new Addon and install it on our production system and found that, after I did the xf-addon:build-release, no zip file was created, though I could see in _build that everything looked right from that process.

Is it that I don't have the ZipArchive class installed on this system (which I noted was required to install from the zip, but no mention was made of this for creating the addon file), or is there just another step required for the zip to be generated?

(Correction, looking at the installed packages on ubuntu, someone did install php8.0-zip and php8.4-zip installed so that must mean I do have the zip requirement met).
 
Last edited:
Did the build output show it completed or was there an error? It'll output "Release written successfully." and the previous line will be the output path. The _build directory gets deleted so if it stuck around long enough for you to look at it it's possible the build didn't complete
 
Hi, thanks for responding.

The output looked like it completed normally with just a notice.

php cmd.php xf-addon:build-release ThreadedView
Performing add-on export.

Exporting data for Threaded View to /var/www/html/src/addons/ThreadedView/_data.

27/27 [============================] 100%
Written successfully.
Attempting to validate addon.json file...
JSON file validates successfully!


In File.php line 43:

[E_NOTICE] tempnam(): file created in the system's temporary directory


xf-addon:build-release [--skip-hashes] [--] <id>
I did check /tmp but nothing new appeared there. (edit) I also checked the _data and it looked reasonable with xml files.
(edit2) I was wrong, /tmp has a 0 byte file that starts with xf (xffIAMC9), no extension.
 
Last edited:
Yeah, looks like it's errored out then as it would have more output after that. After "JSON file validates successfully!" it should say "Building release ZIP.", then "Writing release ZIP to <path>", then "Release written successfully."

File.php seems to be XF\Util\File as line 43 calls tempnam() within getTempFile(). Can't say I've ever seen that error before, by default the temp path is internal_data/temp rather than the system tmp directory. Check that directory is writable I guess, maybe it's falling back to the system tmp directory but something else isn't working.
 
You figured it out. It was permissions though I don't know why since I've been working normally with my plain old userid in the addon directories. I used root and ran the command and it created the zip under the _release directory of my addons/ThreadedView. Certainly a good enough solution for me. I'll see if I can get it to install on the production system now. Thanks very much.

Output was:

# php cmd.php xf-addon:build-release ThreadedView
Performing add-on export.

Exporting data for Threaded View to /var/www/html/src/addons/ThreadedView/_data.
27/27 [============================] 100%
Written successfully.
Attempting to validate addon.json file...
JSON file validates successfully!

Building release ZIP.

Writing release ZIP to /var/www/html/src/addons/ThreadedView/_releases.

Release written successfully.
 
Back
Top Bottom