Composer missing json file error during AtoM 2.6 setup

179 views
Skip to first unread message

Jim McGrath (uOttawa)

unread,
Oct 15, 2021, 3:02:27 PM10/15/21
to AtoM Users
We are building a new DEV/QA AtoM server (the upgrade kept failing) and I am following the vague instructions for installing Composer.  It didn't say where to install it, so I put it in /usr/share/nginx/atom/composer - is this a valid spot?

When I run the command (sudo ~/composer.phar install) from the install instructions (https://www.accesstomemory.org/en/docs/2.6/admin-manual/installation/linux/ubuntu-bionic/) I get a couple of errors.  

1.  The command doesn't work because it's looking in my HOME folder so I used 'sudo ./composer.phar install' instead but then
2.  it complains that I should NOT run it as root (the instructions say to so I continue) and
3.  it fails because there is no composer.json file.  On research/googling I found that this file is to be autogenerated by Composer and it's needed to use it in your project (AtoM presumably).

Is there supposed to be a .json file in AtoM?  Am I supposed to download it separately?  There's nothing in the AtoM install instructions about it, yet they say to install Composer without it, which fails.

Jim McGrath (uOttawa)

unread,
Oct 18, 2021, 11:03:03 AM10/18/21
to AtoM Users
I did try just 'sudo composer install --no-dev' but then it comes back and says that there is no such option, though it looks like that is coming from Symfony).  Yet it's in the instructions for installing AtoM 2.6.  Am I using depreciated components for this install?  Is the documentation outdated/not maintained?  Am I looking at the correct URL (above link in original post) ??

I also see the next step says "after downloading the code" - what code?  Do you mean the libraries?  If not, what is this code that wasn't listed previously?  I'm confused.

Dan Gillean

unread,
Oct 19, 2021, 4:06:39 PM10/19/21
to ICA-AtoM Users
Hi Jim, 

Sorry for the delay - I don't personally use the Docker environment, so I have asked one of our developers to provide some feedback for you soon. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/add3e682-37ab-4d3c-baaa-54aa77927f65n%40googlegroups.com.

Jim McGrath (uOttawa)

unread,
Oct 20, 2021, 10:41:32 AM10/20/21
to AtoM Users
We are not using Docker, our DEV environment is a physical computer.

Dan Gillean

unread,
Oct 20, 2021, 11:55:59 AM10/20/21
to ICA-AtoM Users
Hi Jim, 

Sorry for the confusion!

We will try to improve this for the 2.7 documentation, but in this case I think you should follow the instructions on the Composer page to install it globally, and not in a subdirectory of your AtoM installation directory. This part: 

composer.png

Once you have properly moved the .phar package, then the global command in the AtoM documentation should work. I think the composer command you are trying is failing first to find the right location, but also because you need to use php composer .phar BEFORE this change is made. See the link above for further information and options. 

There is a JSON file in AtoM that, once properly configured, will tell Composer what dependencies we want it to install. See: 
I hope this helps! And as I mentioned, we will add our own Composer installation instructions in the next version, so it's clearer what steps should be followed and how/where Composer should be installed. 

Regards, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him

Jim McGrath (uOttawa)

unread,
Oct 20, 2021, 1:55:29 PM10/20/21
to AtoM Users
That's what I had done, it is installed globally, as per the instructions at getcomposer.org.  And when I run the command (sudo ~/composer .phar install) as indicated in the AtoM install instructions (from the /usr/share/nginx/atom folder) it gives a message that it should not be run with 'sudo', your instructions say that I should be, so I continue and it then complains that there is no .json file.  Is that because we didn't clone from github, which you say there is a .json file?

Their site says you can install it in 2 different ways, locally or globally.  The commands you give above are combining the install instructions from both ways.  Can you confirm this is correct?

And the next line says "after downloading the code" - So what is this 'code' that is being referred to?  Do I ignore that?

---
I am wondering now if I am mixing the 2 different sections in the "Download AtoM" section of the documentation.  There is Option 1 and Option 2.  But there doesn't look to be a distinct 'ending' of option 2.  I did Option 1, should I go all the way down to the "Filesystem Permissions" section?  Because under Option 2, the Install git section looks like it's just downloading AtoM from github, and that's it, and from Option 1 you should continue to the Composer section.  Can you confirm that?  

Thanks!

Dan Gillean

unread,
Oct 20, 2021, 5:21:33 PM10/20/21
to ICA-AtoM Users
Hi Jim, 

Ahhh, yes, I think we've found the issue - you don't need to use Composer if you're following option 1! This is why the instructions are under the Option 2  (installation from the code repository) header and there is no break between the github instructions  and the Composer ones. With the tarball (Option 1), the dependencies that Composer installs are already in AtoM's vendor directory - and the CSS is pre-compiled, so the other instructions about installing less and running the make command also only apply to the Option 2 installation method. 

Composer would also install some additional developer dependencies (vfsstream, phpunit, and phing), but these are not required for a production ready environment, or even a general dev/test server. If you are planning on doing AtoM development, then using the code repository may be easier anyway (so you can pull in any changes, fork, etc), and these packages add support for automated tests, etc. 

So, yes, from option 1 you should jump to the next main heading, Filesystem permissions. Sorry for the confusion! I will try to consider how we can better clarify this in the documentation in the future. 



Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him

Reply all
Reply to author
Forward
0 new messages