eckmar-community / eckmar

Open-source marketplace on Laravel (PHP). Also known as the Eckmar's Marketplace Script.
103 stars 60 forks source link

Error happened! Try again later! #77

Open Klinac opened 1 year ago

Klinac commented 1 year ago

image

I've looked in dev tools and theres an error

Request URL: http://MY-IP/profile/make/purchase? Request Method: GET Status Code: 302 Found

dclipca commented 1 year ago

@botdigit-admin @Gralien do you guys know how to debug this?

Tarun-developer commented 1 year ago

This error from your MakePurchasesRequest you can find this in file request/cart.MakePurchasesRequest.php


public function persist()
    {
        try{
            DB::beginTransaction();
            // foreach item in cart
            foreach (Cart::getCart() -> items() as $productId => $item){
                // Purchase procedure
                $item -> purchased();
                // Persist the purchase
                $item -> save();
            }
            DB::commit();
            // Clear cart after commiting
            Cart::getCart() -> clearCart();
        }
        catch(RequestException $requestException){
            DB::rollBack();
            Log::error($requestException -> getMessage());
            throw new RequestException($requestException -> getMessage());
        }
        catch (\Exception $e){
            \Illuminate\Support\Facades\Log::error($e->getMessage());
            DB::rollBack();
            Log::error($e -> getMessage());
            throw new RequestException('Error happened! Try again later!');
        }
    }

you can see in log or you can print in catch this message

Screenshot 2023-09-16 at 9 32 26 PM
Gralien commented 1 year ago

Again, if the coins are set up correctly and .env correct and the RPC wallet is pinging with curl, then it's a script timeout and fails before node response. This especially happens when node on HDD drives. Extend the timeout.

On Sat, Sep 16, 2023, 9:06 AM botdigit-admin @.***> wrote:

This error from your MakePurchasesRequest you can find this in file request/cart.MakePurchasesRequest.php

public function persist() { try{ DB::beginTransaction(); // foreach item in cart foreach (Cart::getCart() -> items() as $productId => $item){ // Purchase procedure $item -> purchased(); // Persist the purchase $item -> save(); } DB::commit(); // Clear cart after commiting Cart::getCart() -> clearCart(); } catch(RequestException $requestException){ DB::rollBack(); Log::error($requestException -> getMessage()); throw new RequestException($requestException -> getMessage()); } catch (\Exception $e){ \Illuminate\Support\Facades\Log::error($e->getMessage()); DB::rollBack(); Log::error($e -> getMessage()); throw new RequestException('Error happened! Try again later!'); } }

you can see in log or you can print in catch this message [image: Screenshot 2023-09-16 at 9 32 26 PM] https://user-images.githubusercontent.com/28224590/268458159-aef3cbad-3669-4955-9168-1fdbd4156f56.png

— Reply to this email directly, view it on GitHub https://github.com/eckmarcommunity/eckmar/issues/77#issuecomment-1722260796, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXSCEGGY56DCFPO34PDLJ5TX2XFB7ANCNFSM6AAAAAA42TM2BQ . You are receiving this because you were mentioned.Message ID: @.***>