Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 22 18:59
    andreyv closed #1146
  • Nov 22 18:59
    andreyv commented #1146
  • Nov 22 18:29
    andreyv commented #1158
  • Nov 22 16:40

    andreyv on master

    Make PrintingService translatab… (compare)

  • Nov 22 16:40
    andreyv closed #1152
  • Nov 22 16:40
    andreyv commented #1152
  • Nov 22 16:17
    andreyv commented #1151
  • Nov 22 15:20

    andreyv on master

    Don't open title page input fil… (compare)

  • Nov 22 15:20
    andreyv closed #1150
  • Nov 22 15:20
    andreyv commented #1150
  • Nov 15 20:37
    CristianCantoro closed #1166
  • Nov 15 20:37
    CristianCantoro commented #1166
  • Nov 15 20:36
    CristianCantoro closed #1168
  • Nov 15 20:36
    CristianCantoro commented #1168
  • Nov 15 11:52
    wil93 commented #1168
  • Nov 15 11:48
    CristianCantoro opened #1168
  • Nov 15 11:44
    CristianCantoro reopened #1166
  • Nov 15 11:44
    CristianCantoro commented #1166
  • Nov 15 11:35
    CristianCantoro commented #1166
  • Nov 15 11:30
    CristianCantoro closed #1166
Andrey Vihrov
@andreyv
Did you install CMS or you just run it from the source?
MacTin
@MacTin
umactin@vUbuntu:~/cms/scripts$ cmsInitDB
2020-09-20 10:15:05,653 - INFO [<unknown>] Using configuration file /usr/local/etc/cms.conf.
2020-09-20 10:15:06,306 - CRITICAL [<unknown>] Operational error while talking to the DB. Is the connection string in cms.conf correct?
umactin@vUbuntu:~/cms/scripts$
Andrey Vihrov
@andreyv
I guess you are using version 1.4, because the master version prints more information in this place
When you run psql -d cmsdb -U cmsuser -c '\dt' and enter your DB password, does it complete successfully?
MacTin
@MacTin
yes
Andrey Vihrov
@andreyv
What is the output?
MacTin
@MacTin
i lost that output
but I try to do it agen
y show me this output
Andrey Vihrov
@andreyv
Did it say (0 rows) or similar in the end?
MacTin
@MacTin
this is when the problem starting

umactin@vUbuntu:~$ ls
cms Documentos Imágenes Plantillas snap
Descargas Escritorio Música Público Vídeos
umactin@vUbuntu:~$ cd cms
umactin@vUbuntu:~/cms$ ls
AUTHORS.txt cms.egg-info dev-requirements.txt README.md
babel_mapping.cfg cmsranking dist requirements.txt
build cmstaskenv docs scripts
cms cmstestsuite isolate setup.cfg
cmscommon config LICENSE.txt setup.py
cmscontrib debian prerequisites.py
umactin@vUbuntu:~/cms$ cd cms
umactin@vUbuntu:~/cms/cms$ ls
conf.py grading io log.py server util.py
db init.py locale plugin.py service
umactin@vUbuntu:~/cms/cms$ cd ..
umactin@vUbuntu:~/cms$ ls
AUTHORS.txt cms.egg-info dev-requirements.txt README.md
babel_mapping.cfg cmsranking dist requirements.txt
build cmstaskenv docs scripts
cms cmstestsuite isolate setup.cfg
cmscommon config LICENSE.txt setup.py
cmscontrib debian prerequisites.py
umactin@vUbuntu:~/cms$ cd scripts
umactin@vUbuntu:~/cms/scripts$ ls
cmsAdminWebServer cmsEvaluationService cmsProxyService cmsWorker
cmsChecker cmsInitDB cmsRankingWebServer
cmsContestWebServer cmsLogService cmsResourceService
cmsDropDB cmsPrintingService cmsScoringService
umactin@vUbuntu:~/cms/scripts$ cmsInitDB
2020-09-18 09:39:51,109 - INFO [<unknown>] Using configuration file /usr/local/etc/cms.conf.
2020-09-18 09:39:53,083 - CRITICAL [<unknown>] Operational error while talking to the DB. Is the connection string in cms.conf correct?
umactin@vUbuntu:~/cms/scripts$ cmsInitDB
2020-09-18 09:43:10,297 - INFO [<unknown>] Using configuration file /usr/local/etc/cms.conf.
2020-09-18 09:43:10,943 - CRITICAL [<unknown>] Operational error while talking to the DB. Is the connection string in cms.conf correct?
umactin@vUbuntu:~/cms/scripts$ createuser --username=postgres --pwprompt cmsuserEnter password for new role:
Enter it again:
createuser: could not connect to database postgres: FATAL: Peer authentication failed for user "postgres"
umactin@vUbuntu:~/cms/scripts$ createuser --username=postgres --pwprompt cmsuser^C
umactin@vUbuntu:~/cms/scripts$ createuser --username=postgres --pwprompt cmsuserEnter password for new role:
Enter it again:
createuser: could not connect to database postgres: FATAL: Peer authentication failed for user "postgres"
umactin@vUbuntu:~/cms/scripts$ sudo su - postgres
[sudo] contraseña para umactin:
postgres@vUbuntu:~$ createuser --username=postgres --pwprompt cmsuser
Enter password for new role:
Enter it again:
createuser: creation of new role failed: ERROR: role "cmsuser" already exists
postgres@vUbuntu:~$ createdb --username=postgres --owner=cmsuser cmsdb
createdb: database creation failed: ERROR: database "cmsdb" already exists
postgres@vUbuntu:~$ psql --username=postgres --dbname=cmsdb --command='ALTER SCHEMA public OWNER TO cmsuser'
ALTER SCHEMA
postgres@vUbuntu:~$ psql --username=postgres --dbname=cmsdb --command='GRANT SELECT ON pg_largeobject TO cmsuser'
GRANT
postgres@vUbuntu:~$ quit

Orden «quit» no encontrada. Quizá quiso decir:

la orden «luit» del paquete deb «x11-utils»
la orden «quiz» del paquete deb «bsdgames»
la orden «qgit» del paquete deb «qgit»
la orden «quilt» del paquete deb «quilt»
la orden «quot» del paquete deb «quota»

Pruebe con: apt install <nombre del paquete deb>

postgres@vUbuntu:~$ exit
cerrar sesión
umactin@vUbuntu:~/cms/scripts$ ls

Andrey Vihrov
@andreyv
Well, what is the output when you run that command under the umactin user? (I assume this is the system user you want to run CMS under.)
MacTin
@MacTin
In this part

Then, to create the user (which does not need to be a superuser, nor be able to create databases nor roles) and the database, you need the following commands:

createuser --username=postgres --pwprompt cmsuser
createdb --username=postgres --owner=cmsuser cmsdb
psql --username=postgres --dbname=cmsdb --command='ALTER SCHEMA public OWNER TO cmsuser'
psql --username=postgres --dbname=cmsdb --command='GRANT SELECT ON pg_largeobject TO cmsuser'

The last two lines are required to give the PostgreSQL user some privileges

I only give it the password
Andrey Vihrov
@andreyv
Please, try to run psql -d cmsdb -U cmsuser -c '\dt' under your normal user account; what does it output?
MacTin
@MacTin
ok
FATAL: Peer authentication failed for user "cmsuser"
Andrey Vihrov
@andreyv
That is the problem. Please check that the DB password for cmsuser is correct, and that password authentication is allowed for the user (see /etc/postgresql/10/main/pg_hba.conf or similar depending on your postgres version).
Probably you need to set the md5 or similar authentication method for the user
Default is peer authentication, but your Unix user is not cmsuser, so it can't work in this case
MacTin
@MacTin
the pg_hba.conf

PostgreSQL Client Authentication Configuration File

===================================================

#

Refer to the "Client Authentication" section in the PostgreSQL

documentation for a complete description of this file. A short

synopsis follows.

#

This file controls: which hosts are allowed to connect, how clients

are authenticated, which PostgreSQL user names they can use, which

databases they can access. Records take one of these forms:

#

local DATABASE USER METHOD [OPTIONS]

host DATABASE USER ADDRESS METHOD [OPTIONS]

hostssl DATABASE USER ADDRESS METHOD [OPTIONS]

hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]

#

(The uppercase items must be replaced by actual values.)

#

The first field is the connection type: "local" is a Unix-domain

socket, "host" is either a plain or SSL-encrypted TCP/IP socket,

"hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a

plain TCP/IP socket.

#

DATABASE can be "all", "sameuser", "samerole", "replication", a

database name, or a comma-separated list thereof. The "all"

keyword does not match "replication". Access to replication

must be enabled in a separate record (see example below).

#

USER can be "all", a user name, a group name prefixed with "+", or a

comma-separated list thereof. In both the DATABASE and USER fields

you can also write a file name prefixed with "@" to include names

from a separate file.

#

ADDRESS specifies the set of hosts the record matches. It can be a

host name, or it is made up of an IP address and a CIDR mask that is

an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that

specifies the number of significant bits in the mask. A host name

that starts with a dot (.) matches a suffix of the actual host name.

Alternatively, you can write an IP address and netmask in separate

columns to specify the set of hosts. Instead of a CIDR-address, you

can write "samehost" to match any of the server's own IP addresses,

or "samenet" to match any address in any subnet that the server is

directly connected to.

#

METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",

"gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".

Note that "password" sends passwords in clear text; "md5" or

"scram-sha-256" are preferred since they send encrypted passwords.

#

OPTIONS are a set of options for the authentication in the format

NAME=VALUE. The available options depend on the different

authentication methods -- refer to the "Client Authentication"

section in the documentation for a list of which options are

available for which authentication methods.

#

Database and user names containing spaces, commas, quotes and other

special characters must be quoted. Quoting one of the keywords

"all", "sameuser", "samerole" or "replication" makes the name lose

its special character, and just match a database or username with

that name.

#

This file is read on server startup and when the server receives a

SIGHUP signal. If you edit the file on a running system, you have to

SIGHUP the server for the changes to take effect, run "pg_ctl reload",

or execute "SELECT pg_reload_conf()".

#

Put your actual configuration here

----------------------------------

#

If you want to allow non-local connections, you need to add more

"host" records. In that case you will also need to make PostgreSQL

listen on a non-local interface via the listen_addresses

configuration parameter, or via the -i or -h command line switches.

DO NOT DISABLE!

If you change this first entry you will need to make sure that the

database superuser can access the database using some other method.

Noninteractive access to all databases is required during automatic

maintenance (custom daily cronjobs, replication, and similar tasks).

#

Database administrative login by Unix domain socket

local all postgres peer

TYPE DATABASE USER ADDRESS METHOD

"local" is for

"local" is for Unix domain socket connections only

local all all peer

IPv4 local connections:

host all all 127.0.0.1/32 md5

IPv6 local connections:

host all all ::1/128 md5

Allow replication connections from localhost, by a user with the

replication privilege.

local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5

Andrey Vihrov
@andreyv
How does your connection string in cms.conf look, excluding the password?
Andrey Vihrov
@andreyv
@MacTin Anyway, the problem is that your Unix user is not named cmsuser but rather something else. You can fix this by either enabling password authentication for the DB user cmsuser in pg_hba.conf, or, from the looks of the current contents, also by replacing the IP address in cms.conf connection string with 127.0.0.1. There is a link to pg_hba.conf documentation above.
MacTin
@MacTin
I think I fixed the problem
I had created the cmsdb database
and ,I can see ll tables,
            List of relations
Schema | Name | Type | Owner
--------+-----------------------+-------+---------
public | admins | table | cmsuser
public | announcements | table | cmsuser
public | attachments | table | cmsuser
public | contests | table | cmsuser
public | datasets | table | cmsuser
public | evaluations | table | cmsuser
public | executables | table | cmsuser
public | files | table | cmsuser
public | fsobjects | table | cmsuser
public | managers | table | cmsuser
public | messages | table | cmsuser
public | participations | table | cmsuser
public | printjobs | table | cmsuser
public | questions | table | cmsuser
public | statements | table | cmsuser
public | submission_results | table | cmsuser
public | submissions | table | cmsuser
public | tasks | table | cmsuser
public | teams | table | cmsuser
public | testcases | table | cmsuser
:
MacTin
@MacTin
Now, mozilla show this message "Firefox no pudo establecer una conexión con el servidor en localhost:8889."
please, help me.
Andrey Vihrov
@andreyv
@MacTin Have you completed all the steps in https://cms.readthedocs.io/en/v1.4/Running%20CMS.html#configuring-cms and https://cms.readthedocs.io/en/v1.4/Running%20CMS.html#id1? Can you see cmsAdminWebServer running in the process list? What logs do you see at /var/local/log/cms/AdminWebServer-0/last.log?
MacTin
@MacTin
yes,I can, this s the output
umactin@vUbuntu:~/cms/scripts$ cmsAdminWebServer
2020-09-23 06:11:38,903 - INFO [<unknown>] Using configuration file /usr/local/etc/cms.conf.
2020-09-23 06:11:43,121 - INFO [Admin,0] AdminWebServer 0 up and running!
2020-09-23 06:11:43,123 - INFO [Admin,0] Established connection with localhost:21100 (AdminWebServer,0) (local address: 127.0.0.1:57138).
2020-09-23 06:11:43,124 - INFO [Admin,0] Established connection with 127.0.0.1:57138 (local address: 127.0.0.1:21100).
^C2020-09-23 06:12:07,851 - WARNING [Admin,0] AdminWebServer,0 received request to shut down.
2020-09-23 06:12:07,855 - INFO [Admin,0] AdminWebServer 0 is shutting down
2020-09-23 06:12:07,856 - INFO [Admin,0] Terminated connection with localhost:21100 (AdminWebServer,0) (local address: 127.0.0.1:57138): Disconnection requested.
the last log is: 2020-09-22 22:49:02,339 - INFO [Log,0 Main service::run] LogService 0 up and running!
MacTin
@MacTin
Is localhost:8889 the orrect url?
MacTin
@MacTin
but the mozzilla did not found the localhost:8889 URL
Andrey Vihrov
@andreyv
@MacTin I see AdminWebServer 0 is shutting down in the output. Normally, you should be starting cmsResourceService -a (see the docs) and leave it running. In the process list, you'll see various CMS services. You can use e.g. screen to keep cmsResourceService running at all times.
mostafa ammar
@mostafaammar79_twitter
any tutorials how to create a distributed setup for cms . web server and multiple worker servers and remote database setup
mostafa ammar
@mostafaammar79_twitter

any tutorials how to create a distributed setup for cms . web server and multiple worker servers and remote database setup

@wil93

MacTin
@MacTin
Thank you, the cms system is working .
MacTin
@MacTin
Is there examples about Contests,
MacTin
@MacTin
or, where can i find example tasks?
Andrey Vihrov
@andreyv
@MacTin The simplest way is just to create the tasks yourself. For example, you can use the AdminWebServer interface to create a "Sum" task where, given two numbers, you need to output their sum. After setting task type (Batch) and limits, you can add it to a contest, and then the task will appear in the contestant interface.
MacTin
@MacTin
Thank you
Edoardo Morassutto
@edomora97

any tutorials how to create a distributed setup for cms . web server and multiple worker servers and remote database setup

A while ago I made a step-by-step tutorial for deploying cms on Google Cloud Platform. It's a little bit out of date, but can be useful for starting up from scratch.

https://docs.google.com/presentation/d/1GA6UNPa9wBrihoATKHcINNlCOgcmQrBCAX9yk85d4Tk/

Enjoy!

@mostafaammar79_twitter