Installing Streams Module addon.
Created 5 years ago by ikoniqoz

This page: https://pyrocms.com/help/developer-tools/cheatsheets/installing-pro-addons explains how to carry out the installation of the module. However, I followed the link on create a new personal access token and was grateful to see that the the form shown here: https://github.com/settings/tokens/new?scopes=repo&description=PyroCMS generated an access token that gives the following error: [UnexpectedValueException]
Your github oauth token for github.com contains invalid characters: "PyroCMS" So I moved on from that to see if I could find another way and discovered this page: https://pyrocms.com/documentation/streams-module/1.3/introduction/installation and also realised that the last option given on the page is the one I had used when I started exploring Pyro 3.x 18 months ago or more.... Sadly, when I attempt to use this last option, I get the following error: In Connection.php line 664: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from default_settings_settings)
In PDOConnection.php line 47: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 43: SQLSTATE[HY000] [2002] No such file or directory
Can anyone give me a clue on what I am doing wrong ?

ryanthompson  —  5 years ago

Sorry to hear of the troubles!

The first error (then token) is sometimes caused when accidentally copying in additional characters with the token. It should be the hash ONLY: composer config -g github-oauth.github.com RANDOM_HASH_FROM_GITHUB

The second says that your DB is not running or doesn't exist. Assuming you are installed - is your DB running? Does the DB described in your .env file exist and have that table?

ikoniqoz  —  5 years ago

Thanks for your quick reply Ryan. Not worried about the first error for the moment, so with Terminal I moved into the top level folder for a copy of 3.6.4 install I have up and running. Then I executed this: Johns-MacBook-Air-2:pyro364.local Mac$ php artisan addon:install anomaly.module.streams I got the following errors: In Connection.php line 664:
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from defau lt_addons_modules where installed = 1 and enabled = 1)
In PDOConnection.php line 47: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 43: SQLSTATE[HY000] [2002] No such file or directory
Same problem I have with 3.4.0 install. Its worth mentioning that I have in the past used this process with my old copy of pyro 3.3.3 - but cant run that under MAMP cos MAMP dont include the version of PHP thats needed (5.6?). So am I executing the artisan command in the correct location ? Is it finger trouble at my end ?

ikoniqoz  —  5 years ago

More on this..... I am in the root directory for the site here is what happened: Johns-MacBook-Air-2:pyro364.local Mac$ php artisan --version In Connection.php line 664:
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from default_addons_modules where installed = 1 and enabled =
1)
In PDOConnection.php line 47: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 43: SQLSTATE[HY000] [2002] No such file or directory
Johns-MacBook-Air-2:pyro364.local Mac$

ryanthompson  —  5 years ago

This is saying that your database is not connected. Here is some information on it: https://www.google.com/search?q=SQLSTATE%5BHY000%5D+%5B2002%5D+No+such+file+or+directory&oq=SQLSTATE%5BHY000%5D+%5B2002%5D+No+such+file+or+directory&aqs=chrome..69i57.71j0j7&sourceid=chrome&ie=UTF-8

Could be your MySQL driver. Maybe post your .env file information (less any private information in it). Should be safe given this is your local server though 😄

ryanthompson  —  5 years ago

It could be a problem with your PHP version - PyroCMS v3.6 is PHP 7.0+ only. Sorry I didn't see that earlier.

ikoniqoz  —  5 years ago

Thanks for your suggestions Ryan and for hanging in there with this. Some more background: I have a site running 3.4.0 and another running 3.6.4. I can add content, posts and create new pages. I also have a pyro2.2.5 site up and running along with pyro2 docs - all on MAMPS 5.2. As a result of this I have url's that include the .8888 port. eg: http://pyro340.local:8888/contact
I am experiencing the same php artisan issue with both the http://pyro340.local:8888 site and the http://pyro364.local:8888 site. Just to be clear, the folder where I have placed the addon module is in: /addons/shared/anomaly/streams-module . Another gem: If I include the image-field_type in the anomaly folder I get the following: Users/Mac/Sites/pyro364.local/vendor/laravel/framework/src/Illuminate/Container/Container.php }

/**
 * Instantiate a concrete instance of the given type.
 *
 * @param  string  $concrete
 * @return mixed
 *
 * @throws \Illuminate\Contracts\Container\BindingResolutionException
 */
public function build($concrete)
{
    // If the concrete type is actually a Closure, we will just execute it and
    // hand back the results of the functions, which allows functions to be
    // used as resolvers for more fine-tuned resolution of these objects.
    if ($concrete instanceof Closure) {
        return $concrete($this, $this->getLastParameterOverride());
    }

    $reflector = new ReflectionClass($concrete);

    // If the type is not instantiable, the developer is attempting to resolve
    // an abstract type such as an Interface of Abstract Class and there is
    // no binding registered for the abstractions so we need to bail out.
    if (! $reflector->isInstantiable()) {
        return $this->notInstantiable($concrete);
    }

    $this->buildStack[] = $concrete;

    $constructor = $reflector->getConstructor();

    // If there are no constructors, that means there are no dependencies then
    // we can just resolve the instances of the objects right away, without
    // resolving any other types or dependencies out of these containers.
    if (is_null($constructor)) {
        array_pop($this->buildStack);

        return new $concrete;
    }

Arguments "Class Anomaly\ImageFieldType\ImageFieldType does not exist" BOTTOM LINE: With my earlier v3.3.3 site - everything just worked as advertised - but that was before I had MAMP and MAMP does not support php 5.6.4 for pyro3.3. so I cant run that site as a sanity check. So, where am I going wrong here ? It must be something very basic I am missing......

ryanthompson  —  5 years ago

Earlier version of Pyro v3 had an automatic autoloader so you didn't need to run composer dump-autoload. Unfortunately it's slow / not performant so you might need to run composer dump-autoload.

In generally however - it's highly recommended to let Composer manage your addons.

If you delete your image/streams module in shared addons - you can run this to allow composer to bring them in and autoload them for you:

composer require anomaly/streams-module anomaly/image-field_type
ikoniqoz  —  5 years ago

Thanks for the suggestion Ryan. I have attempted to run that but get the following error: [UnexpectedValueException]
Your github oauth token for github.com contains invalid characters: "PyroCMS" That is a pain in the #$@#! since days ago I deleted the github oauth tokens I had created - and still I get this error. All these composer and artisan issues are totally frustrating. - What a waste of time all this is.

ikoniqoz  —  5 years ago

Following on from my earlier post above:: On the second last line in this page: https://pyrocms.com/help/developer-tools/cheatsheets/installing-pro-addons there is a link to github where if the link is followed by clicking on it, (Thanks for that) one sees a pre-filled form with "PyroCMS" given as a "Token Description" - In the list of options for the token all in the "repo" section are pre-selected, so I simply hit the "Generate Token" button. However, for some reason PyroCMS was saved as the token and I have no idea about how to get rid of it since as I said in the previous post above, I cant get rid of this error and so far have not found the solution.

ryanthompson  —  5 years ago

Hey John - please do get ahold of me on Slack: https://pyrocms.com/slack

I know it's a little tough transitioning from the 2.x stuff but I think I can help you across these hurdles if you wanna just poke me so I can get hands on with ya. I see you've almost got it going on another thread (after dumping autoload). The invitation is open! I hate for you to keep struggling with it.