aimeos / aimeos-laravel

Laravel ecommerce package for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
https://aimeos.org/Laravel
MIT License
7.26k stars 1.05k forks source link

Locale item for site "default" not found #100

Closed ramsaiphp closed 7 years ago

ramsaiphp commented 7 years ago

My Os is ubuntu 14.04 and php 7.0 i am trying to access frontend with http://localhost:8000/index.php/list

image

aimeos commented 7 years ago

Guess you either didn't run php artisan aimeos:setup --option=setup/default/demo:1 or you've deleted the default locale entry in the expert mode admin interface.

ramsaiphp commented 7 years ago

after running as you said above. Below is the result i am getting:

Welcome@Admin MINGW64 /d/Sites/chokokart $ php artisan aimeos:setup --option=setup/default/demo:1 Initializing or updating the Aimeos database tables for site "default" Changing typeid of mshop_attribute table OK Renaming catalog tree table Checking table "mshop_catalog_tree": OK Adding code column to mshop_catalog OK Renaming product warehouse table OK Adding ctime/mtime/user columns to tables Checking table "mshop_attribute" for column "mtime": OK Checking table "mshop_attribute" for column "ctime": OK Checking table "mshop_attribute" for column "editor": OK Checking table "mshop_attribute_list" for column "mtime": OK Checking table "mshop_attribute_list" for column "ctime": OK Checking table "mshop_attribute_list" for column "editor": OK Checking table "mshop_attribute_list_type" for column "mtime": OK Checking table "mshop_attribute_list_type" for column "ctime": OK Checking table "mshop_attribute_list_type" for column "editor": OK Checking table "mshop_attribute_type" for column "mtime": OK Checking table "mshop_attribute_type" for column "ctime": OK Checking table "mshop_attribute_type" for column "editor": OK Checking table "mshop_customer" for column "editor": OK Checking table "mshop_customer_address" for column "mtime": OK Checking table "mshop_customer_address" for column "ctime": OK Checking table "mshop_customer_address" for column "editor": OK Checking table "mshop_customer_list" for column "mtime": OK Checking table "mshop_customer_list" for column "ctime": OK Checking table "mshop_customer_list" for column "editor": OK Checking table "mshop_customer_list_type" for column "mtime": OK Checking table "mshop_customer_list_type" for column "ctime": OK Checking table "mshop_customer_list_type" for column "editor": OK Checking table "mshop_locale" for column "mtime": OK Checking table "mshop_locale" for column "ctime": OK Checking table "mshop_locale" for column "editor": OK Checking table "mshop_locale_currency" for column "mtime": OK Checking table "mshop_locale_currency" for column "ctime": OK Checking table "mshop_locale_currency" for column "editor": OK Checking table "mshop_locale_language" for column "mtime": OK Checking table "mshop_locale_language" for column "ctime": OK Checking table "mshop_locale_language" for column "editor": OK Checking table "mshop_locale_site" for column "mtime": OK Checking table "mshop_locale_site" for column "ctime": OK Checking table "mshop_locale_site" for column "editor": OK Renaming order tables Checking table "mshop_order_address": OK Checking table "mshop_order_discount": OK Checking table "mshop_order_product": OK Checking table "mshop_order_service": OK Checking table "mshop_order_service_attribute": OK Adding id to order service attribute table Checking column "id": OK Adding siteid to order tables Checking table "mshop_order_base": OK Checking table "mshop_order": OK Checking table "mshop_order_base_address": OK Checking table "mshop_order_base_discount": OK Checking table "mshop_order_base_product": OK Checking table "mshop_order_base_service": OK Checking table "mshop_order_base_product_attr": OK Checking table "mshop_order_base_service_attr": OK Renaming global tables Changeing locale sites to tree of sites Checking column "mshop_locale_site.level": OK Checking column "mshop_locale_site.nleft": OK Checking column "mshop_locale_site.nright": OK Changing site ID to NOT NULL Changing table "madmin_job": OK Changing table "mshop_attribute": OK Changing table "mshop_attribute_list": OK Changing table "mshop_attribute_list_type": OK Changing table "mshop_attribute_type": OK Changing table "mshop_catalog": OK Changing table "mshop_catalog_index_attribute": OK Changing table "mshop_catalog_index_catalog": OK Changing table "mshop_catalog_index_price": OK Changing table "mshop_catalog_index_text": OK Changing table "mshop_catalog_list": OK Changing table "mshop_catalog_list_type": OK Changing table "mshop_coupon": OK Changing table "mshop_coupon_code": OK Changing table "mshop_customer_list": OK Changing table "mshop_customer_list_type": OK Changing table "mshop_locale": OK Changing table "mshop_media": OK Changing table "mshop_media_list": OK Changing table "mshop_media_list_type": OK Changing table "mshop_media_type": OK Changing table "mshop_plugin": OK Changing table "mshop_plugin_type": OK Changing table "mshop_price": OK Changing table "mshop_price_type": OK Changing table "mshop_product": OK Changing table "mshop_product_list": OK Changing table "mshop_product_list_type": OK Changing table "mshop_product_stock": OK Changing table "mshop_product_stock_warehouse": OK Changing table "mshop_product_tag": OK Changing table "mshop_product_tag_type": OK Changing table "mshop_product_type": OK Changing table "mshop_service": OK Changing table "mshop_service_list": OK Changing table "mshop_service_list_type": OK Changing table "mshop_service_type": OK Changing table "mshop_supplier": OK Changing table "mshop_supplier_address": OK Changing table "mshop_text": OK Changing table "mshop_text_list": OK Changing table "mshop_text_list_type": OK Changing table "mshop_text_type": OK Renaming catalog index tables to index Checking table "mshop_catalog_index_attribute" OK Checking table "mshop_catalog_index_catalog" OK Checking table "mshop_catalog_index_price" OK Checking table "mshop_catalog_index_text" OK Changing "domain" columns Checking table "mshop_attribute": OK Checking table "mshop_attribute_type": OK Checking table "mshop_attribute_list_type": OK Checking table "mshop_attribute_list": OK Checking table "mshop_catalog": OK Checking table "mshop_catalog_list_type": OK Checking table "mshop_catalog_list": OK Checking table "mshop_catalog_suggest": OK Checking table "mshop_media_type": OK Checking table "mshop_media_list_type": OK Checking table "mshop_media": OK Checking table "mshop_media_list": OK Checking table "mshop_plugin": OK Checking table "mshop_price": OK Checking table "mshop_product_type": OK Checking table "mshop_product_list_type": OK Checking table "mshop_product_list": OK Checking table "mshop_product_tag_type": OK Checking table "mshop_service": OK Checking table "mshop_service_list_type": OK Checking table "mshop_service_list": OK Checking table "mshop_text_type": OK Checking table "mshop_text": OK Checking table "mshop_text_list_type": OK Checking table "mshop_text_list": OK Renaming column "discount" to "rebate" Checking table "mshop_price" OK Checking table "mshop_order_base" OK Checking table "mshop_order_base_product" OK Checking table "mshop_order_base_service" OK Renaming discount tables Adding mtime, ctime, editor columns to coupon tables Checking table "mshop_coupon" Checking table "mshop_coupon_code" Checking table "mshop_order_base_coupon" Migrating configuration keys in coupon tables OK Adding status column to all list tables Checking table "mshop_attribute_list": OK Checking table "mshop_catalog_list": OK Checking table "mshop_customer_list": OK Checking table "mshop_media_list": OK Checking table "mshop_price_list": OK Checking table "mshop_product_list": OK Checking table "mshop_service_list": OK Checking table "mshop_text_list": OK Changing typeid of mshop_media table OK Adding product ID to order base product table Checking table "mshop_order_base_product": OK Adding warehouse code to order base product table OK Adding service ID to order base service table Checking table "mshop_order_base_service": OK Migrating order address salutations Checking table "mshop_order_base_address": OK Adding tax column to order tables Checking table "mshop_order_base_product": OK Checking table "mshop_order_base_service": OK Checking table "mshop_order_base": OK Migrating order emailflag colum to order status list Fixing order email status values OK Migrating order flags to order status list Migrating order type Checking table "mshop_order": OK Renaming order base customercode to customerid Checking table "mshop_order_base": OK Renaming order base product amount to quantity Checking table "mshop_order_base_product": OK Renaming order columns pdate,ddate,dstatus,pstatus Checking columne "ddate": OK Checking columne "pdate": OK Checking columne "pstatus": OK Checking columne "dstatus": OK Renaming order domain Checking table "mshop_order": OK Checking table "mshop_order_base_address": OK Checking table "mshop_order_base_service": OK Renaming shipping to costs Checking table "mshop_order_base": OK Checking table "mshop_order_base_product": OK Checking table "mshop_order_base_service": OK Renaming column "price" to "value" Checking table "mshop_price" OK Renaming shipping to costs Checking table "mshop_price": OK Rename "prodid" to "parentid" in table "mshop_product_stock" Checking column "prodid" OK Changing code from "product" to "default" in "mshop_product_type" OK Changing typeid column of product table Checking table "mshop_product": OK Migrating product property domain to "product" OK Changing warehouseid column in mshop_product_stock OK Adding label and status columns for product warehouse Rename warehouse table Rename "mshop_product_stock_wareshouse" OK Drop "mshop_product_stock.fk_msprost_stock_warehouseid" OK Rename "mshop_product_stock.wareshouseid" OK Move stock tables to own domain Checking "mshop_product_stock" OK Checking "mshop_product_stock_type" OK Migrate product code in stock table Migrating subject tables Checking table "mshop_subject_customer": OK Checking table "mshop_subject_supplier": OK Checking table "mshop_subject_common_address": OK Checking table "mshop_subject": OK Moving product tag tables to own domain Moving table "mshop_product_tag_type" OK Moving table "mshop_product_tag" OK Adding label to mshop text table OK Changing typeid of mshop_text table OK Adding parentid column to catalog and locale_site Checking parentid column in "mshop_catalog" OK Checking parentid column in "mshop_locale_site" OK Creating base tables Using schema from locale.php Checking table "mshop_locale_site": done Checking table "mshop_locale_language": done Checking table "mshop_locale_currency": done Checking table "mshop_locale": done Using schema from attribute.php Checking table "mshop_attribute_type": done Checking table "mshop_attribute": done Checking table "mshop_attribute_list_type": done Checking table "mshop_attribute_list": done Using schema from customer.php Checking table "mshop_customer": done Checking table "mshop_customer_address": done Checking table "mshop_customer_list_type": done Checking table "mshop_customer_list": done Checking table "mshop_customer_group": done Checking table "users":

[Aimeos\MW\DB\Exception] Executing statement "CREATE UNIQUE INDEX unq_lvusr_email ON users (email)" failed: An exception occurred while executing 'CREATE UNIQUE INDEX unq_lvus r_email ON users (email)': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t oo long; max key length is 767 bytes

aimeos commented 7 years ago

Which Laravel and Aimeos version do you use?

Laravel 5.4 uses utf8mb4 by default which causes such problems. Maybe this helps: http://geektnt.com/laravel-5-4-migration-unique-key-is-too-long.html

ramsaiphp commented 7 years ago

laravel:5.4.11. Php:7.0 Aimeos 2017.x

aimeos commented 7 years ago

Did you tried the suggestions in the article?

ramsaiphp commented 7 years ago

Yes i tried but after all that i am getting only one error, when i did php artisan aimeos:setup --option=setup/default/demo:1

[Aimeos\MW\DB\Exception]
Executing statement "CREATE UNIQUE INDEX unq_lvusr_email ON users (email)"
failed: An exception occurred while executing 'CREATE UNIQUE INDEX unq_lvus
r_email ON users (email)':
SQLSTATE[HY000]: General error: 1709 Index column size too large. The maxim
um column size is 767 bytes. two times i have dropped the database and checked the problem is with the email in users table of size varchar(255), but if we give value 191 it is creating unique index. when i run php artisan aimeos:setup --option=setup/default/demo:1 after executing all the tables when trying to alter the users table it is giving below error. [Aimeos\MW\DB\Exception]
Executing statement "ALTER TABLE users ADD label VARCHAR(255) NOT NULL, A
DD salutation VARCHAR(8) NOT NULL, ADD company VARCHAR(100) NOT NULL, ADD v
atid VARCHAR(32) NOT NULL, ADD title VARCHAR(64) NOT NULL, ADD firstname VA
RCHAR(64) NOT NULL, ADD lastname VARCHAR(64) NOT NULL, ADD address1 VARCHAR
(200) NOT NULL, ADD address2 VARCHAR(200) NOT NULL, ADD address3 VARCHAR(20
0) NOT NULL, ADD postal VARCHAR(16) NOT NULL, ADD city VARCHAR(200) NOT NUL
L, ADD state VARCHAR(200) NOT NULL, ADD langid VARCHAR(5) DEFAULT NULL, ADD
countryid CHAR(2) DEFAULT NULL, ADD telephone VARCHAR(32) NOT NULL, ADD te
lefax VARCHAR(32) NOT NULL, ADD website VARCHAR(255) NOT NULL, ADD longitud
e NUMERIC(8, 6) DEFAULT NULL, ADD latitude NUMERIC(8, 6) DEFAULT NULL, ADD
birthday DATE DEFAULT NULL, ADD vdate DATE DEFAULT NULL, ADD status SMALLIN
T NOT NULL, ADD editor VARCHAR(255) NOT NULL, CHANGE id id INT AUTO_INCREME
NT NOT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE created_at cr
eated_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL"
failed: An exception occurred while executing 'ALTER TABLE users ADD labe l VARCHAR(255) NOT NULL, ADD salutation VARCHAR(8) NOT NULL, ADD company V
ARCHAR(100) NOT NULL, ADD vatid VARCHAR(32) NOT NULL, ADD title VARCHAR(64)
NOT NULL, ADD firstname VARCHAR(64) NOT NULL, ADD lastname VARCHAR(64) NOT
NULL, ADD address1 VARCHAR(200) NOT NULL, ADD address2 VARCHAR(200) NOT NU
LL, ADD address3 VARCHAR(200) NOT NULL, ADD postal VARCHAR(16) NOT NULL, AD
D city VARCHAR(200) NOT NULL, ADD state VARCHAR(200) NOT NULL, ADD langid V
ARCHAR(5) DEFAULT NULL, ADD countryid CHAR(2) DEFAULT NULL, ADD telephone V
ARCHAR(32) NOT NULL, ADD telefax VARCHAR(32) NOT NULL, ADD website VARCHAR(
255) NOT NULL, ADD longitude NUMERIC(8, 6) DEFAULT NULL, ADD latitude NUMER
IC(8, 6) DEFAULT NULL, ADD birthday DATE DEFAULT NULL, ADD vdate DATE DEFAU
LT NULL, ADD status SMALLINT NOT NULL, ADD editor VARCHAR(255) NOT NULL, CH
ANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE email email VARCHAR(255) NOT
NULL, CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at up
dated_at DATETIME NOT NULL':
SQLSTATE[HY000]: General error: 1709 Index column size too large. The maxim
um column size is 767 bytes.

aimeos commented 7 years ago

The length of the column will automatically be changed back by the migration scripts. Did you try to change the collation instead to utf_general_ci? That stays untouched and doesn't require four bytes per character.

ramsaiphp commented 7 years ago

so i should kept default colliation as default while creating database. Is this correct?

aimeos commented 7 years ago

Laravel 5.4 uses utf8mb4 as default collation for new tables. If you change the collation of the table/columns to utf8_general_ci, this should be short enough to create the index within the limits.

ramsaiphp commented 7 years ago

created database like below: image i have made change as mentioned in below link: https://laravel-news.com/laravel-5-4-key-too-long-error

After all the above running the command php artisan aimeos:setup --option=setup/default/demo:1 still getting the alter table error for users table as mentioned above:

aimeos commented 7 years ago

Changing the default collation isn't enough. After the users table is created by Laravel, you have to change the collation of the table and its columns to utf8_general_ci

ramsaiphp commented 7 years ago

after sorting out all the above measures while running demo command still getting error as below: Processing customer demo data

[Aimeos\MW\DB\Exception]
Executing statement "
SELECT lvu."id" AS "customer.id",
lvu."label" AS "customer.label", lvu."name" AS "customer.code",
lvu."company" AS "customer.company", lvu."vatid" AS "customer.vatid",
lvu."salutation" AS "customer.salutation", lvu."title" AS "customer.title",
lvu."firstname" AS "customer.firstname", lvu."lastname" AS "customer.lastname",
lvu."address1" AS "customer.address1", lvu."address2" AS "customer.address2",
lvu."address3" AS "customer.address3", lvu."postal" AS "customer.postal",
lvu."city" AS "customer.city", lvu."state" AS "customer.state",
lvu."countryid" AS "customer.countryid", lvu."langid" AS "customer.langid",
lvu."telephone" AS "customer.telephone",lvu."telefax" AS "customer.telefax",
lvu."email" AS "customer.email", lvu."website" AS "customer.website",
lvu."longitude" AS "customer.longitude", lvu."latitude" AS "customer.latitude",
lvu."birthday" AS "customer.birthday", lvu."status" AS "customer.status",
lvu."vdate" AS "customer.dateverified", lvu."password" AS "customer.password",
lvu."created_at" AS "customer.ctime", lvu."updated_at" AS "customer.mtime",
lvu."editor" AS "customer.editor"
FROM "users" AS lvu

        WHERE ( lvu."name" LIKE 'demo-%' )                                                                           
        GROUP BY lvu."id", lvu."label", lvu."name", lvu."company", lvu."vatid",                                      
            lvu."salutation", lvu."title", lvu."firstname", lvu."lastname",                                             
            lvu."address1", lvu."address2", lvu."address3", lvu."postal",                                               
            lvu."city", lvu."state", lvu."countryid", lvu."langid",                                                     
            lvu."telephone", lvu."telefax", lvu."email", lvu."website",                                                 
            lvu."longitude", lvu."latitude", lvu."birthday", lvu."status",                                              
            lvu."vdate", lvu."password", lvu."created_at", lvu."updated_at",                                            
            lvu."editor"                                                                                                

        LIMIT 100 OFFSET 0                                                                                           
    " failed: An exception occurred while executing '                                                             
        SELECT lvu."id" AS "customer.id",                                                                            
            lvu."label" AS "customer.label", lvu."name" AS "customer.code",                                             
            lvu."company" AS "customer.company", lvu."vatid" AS "customer.vatid",                                       
            lvu."salutation" AS "customer.salutation", lvu."title" AS "customer.title",                                 
            lvu."firstname" AS "customer.firstname", lvu."lastname" AS "customer.lastname",                             
            lvu."address1" AS "customer.address1", lvu."address2" AS "customer.address2",                               
            lvu."address3" AS "customer.address3", lvu."postal" AS "customer.postal",                                   
            lvu."city" AS "customer.city", lvu."state" AS "customer.state",                                             
            lvu."countryid" AS "customer.countryid", lvu."langid" AS "customer.langid",                                 
            lvu."telephone" AS "customer.telephone",lvu."telefax" AS "customer.telefax",                                
            lvu."email" AS "customer.email", lvu."website" AS "customer.website",                                       
            lvu."longitude" AS "customer.longitude", lvu."latitude" AS "customer.latitude",                             
            lvu."birthday" AS "customer.birthday", lvu."status" AS "customer.status",                                   
            lvu."vdate" AS "customer.dateverified", lvu."password" AS "customer.password",                              
            lvu."created_at" AS "customer.ctime", lvu."updated_at" AS "customer.mtime",                                 
            lvu."editor" AS "customer.editor"                                                                           
        FROM "users" AS lvu                                                                                          

        WHERE ( lvu."name" LIKE 'demo-%' )                                                                           
        GROUP BY lvu."id", lvu."label", lvu."name", lvu."company", lvu."vatid",                                      
            lvu."salutation", lvu."title", lvu."firstname", lvu."lastname",                                             
            lvu."address1", lvu."address2", lvu."address3", lvu."postal",                                               
            lvu."city", lvu."state", lvu."countryid", lvu."langid",                                                     
            lvu."telephone", lvu."telefax", lvu."email", lvu."website",                                                 
            lvu."longitude", lvu."latitude", lvu."birthday", lvu."status",                                              
            lvu."vdate", lvu."password", lvu."created_at", lvu."updated_at",                                            
            lvu."editor"                                                                                                

        LIMIT 100 OFFSET 0                                                                                           
    ':                                                                                                            

SQLSTATE[HY001]: Memory allocation error: 1038 Out of sort memory, consider increasing server sort buffer size

aimeos commented 7 years ago

This is another MySQL issue in new versions. The default sort_buffer_size has been reduced and is way to small. Please have a look here: https://github.com/aimeos/aimeos-laravel/issues/99