error when installing package created with package designer

Permalink Browser Info Environment
Hi, I have created custom blocks with block designer and packed them up with package designer, but I am getting an error, when trying to install the package.
Here is the error. I am attaching screenshot of the error. can you please help me with this? thanks.

An exception occurred while executing 'INSERT INTO Packages (pkgHandle, pkgVersion, pkgIsInstalled, pkgAvailableVersion, pkgDescription, pkgDateInstalled, pkgName) VALUES (?, ?, ?, ?, ?, ?, ?)' with params ["parallax_slider_with_controls", "0.9.0", 1, null, "Parallax slider", "2017-03-20 17:26:44", "Parallax_slider"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'parallax_slider_with_controls' for key 'UNIQ_62C3A2F1F2D49DB1'

1 Attachment

Type: Discussion
Status: Resolved
gotemperor
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

Did you try using a different "handle" for the package? It seems that the handle is still available in the database, but it's not a created folder on your server. So something got messed up (or manually deleted).

Let me know if that worked.

Kind regards,

Ramon
gordonc200 replied on at Permalink Reply
gordonc200
Hi Ramon

I'm having exactly the same issue. Even installing the created package on a completely clean c5 install with no previous packages installed.

Doctrine \ DBAL \ Exception \ UniqueConstraintViolationException

An exception occurred while executing 'INSERT INTO Packages (pkgHandle, pkgVersion, pkgIsInstalled, pkgAvailableVersion, pkgDescription, pkgDateInstalled, pkgName) VALUES (?, ?, ?, ?, ?, ?, ?)' with params ["package_handle_here", "0.1.0", 1, null, "Package description here", "2017-05-20 18:29:09", "Package Name"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'package_handle_here' for key 'UNIQ_62C3A2F1F2D49DB1'

This sort of error has been happening on a few packages (from other developers) I've tried to install recently. I'm using version 8.1. It didn't have the problem in previous versions.
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

Can you send me the config.json file created with the package? I then can test it with version 8.1 and try and fix it (if I get the same errors). I haven't seen it myself before, so I'd have to investigate this!

Kind regards,

Ramon
gordonc200 replied on at Permalink Reply 1 Attachment
gordonc200
Hi Ramon

Please see attached.
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

Just tried on a fresh install of concrete5 version 8.1.0 and works perfectly with your configuration. Tried installing and uninstalling, no issues there. Did you download the concrete5 version here from the website or from GitHub?

Also, what is the link to the forum post? This seems like a concrete5 bug in combination with a specific environment. Had 0 issues so far to be honest with you. On what kind of machine are you running this?

Do you have these issues when creating a package with a different handle? It seems like there's already an entry in the database upon installing, which causes this error. What happens when you go to the "Packages" database table and remove the complete entry with "wg_portal_package" under the "pkgHandle" column? Of course not the way to go, but it seems like something's going wrong for a really weird reason.

Let me know what your discoveries are!

Kind regards,

Ramon
gordonc200 replied on at Permalink Reply
gordonc200
Hi Ramon

Environment Info is as follows.

I'm not sure this is a Package Designer Issue now as another Marketplace Package I tried to install last night broke a C5 site completely. I just tried to install the Package Designer created package again on a completely clean c5 install and it did the same thing. This wasn't an issue before.

The only thing I had been messing about with recently was the servers PHP handler but this was before this new issue of complete wipeout of c5 sites.

# concrete5 Version
Core Version - 8.1.0
Version Installed - 8.1.0
Database Version - 20170123000000

# concrete5 Packages
None

# concrete5 Overrides
languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache/2.4.18 (Ubuntu)

# Server API
apache2handler

# PHP Version
5.6.30-10+deb.sury.org~xenial+2

# PHP Extensions
apache2handler, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mhash, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 90
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 100M
sql.safe_mode - Off
upload_max_filesize - 100M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5
ramonleenders replied on at Permalink Reply
ramonleenders
Are you able to upgrade your PHP version? Not sure if that helps, but it may. I'm running version 7.x myself. Also on Ubuntu by the way. Never had any issues on 5.6 myself, but haven't been running version 8 on it myself. Other than that.. no clue. Perhaps try the forums? This obviously is an issue with environment in combination with concrete5, but I just don't know what it is... Core developers are probably more capable of being able to track this down.

Kind regards,

Ramon
gordonc200 replied on at Permalink Reply
gordonc200
I'm sure I encountered issues with upgrading before. It's not really a route I'm keen to go down.

I think at the moment I need to work out what's broken in my current configuration.

I've struggled in the past to find optimal server settings for c5. I know there's advice on c5's install requirements but it would be good if the "ideal" setup was documented somewhere.
ramonleenders replied on at Permalink Reply
ramonleenders
Requirements are here:

https://documentation.concrete5.org/developers/installation/system-r...

I do advice PHP7 if you can, as it's a whole lot faster (and better of course). Other than that, I've got no idea what else you could do. Best thing right now would be post it on the forums and get as many attention as possible!
gordoncWG replied on at Permalink Reply
gordoncWG
I eventually got this to work. When package designer creates a package with more than one block in my system it does something like this. It had if statements in there too which I also deleted. Probably not advisable, who knows? I imagine it was some sort of validation code to make sure a block with the same handle wasn't already installed. Anyway original code was something like

public function install()
    {
        $pkg = parent::install();
        BlockType::installBlockType('block_handle_one', $pkg);
        $pkg = parent::install();
        BlockType::installBlockType('block_handle_two', $pkg);        
    }


Changing it to this works

public function install()
    {
        $pkg = parent::install();
        BlockType::installBlockType('block_handle_one', $pkg);
        BlockType::installBlockType('block_handle_two', $pkg);        
    }


Using the original code the package does install but only the first block installs. Using the second block of code installs both blocks without errors.

My solution probably isn't the best way of doing things, I don't know, but I hope it helps.
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Gordon,

Thanks for noticing this. I will be able to investigate and correct that tomorrow. Your code seems just fine, but I will make the code slightly different though (in case of A LOT of block types, you don't want to copy that line 15 times for example).

Kind regards,

Ramon
ramonleenders replied on at Permalink Reply
ramonleenders
Hi Gordon,

Version 0.9.6 should fix the issue for the future! :)

Kind regards,

Ramon
gordoncWG replied on at Permalink Reply
gordoncWG
Glad it turns out I could actually help! :)

concrete5 Environment Information

localhost

Browser User-Agent String

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.