{"id":33,"date":"2004-11-11T19:48:11","date_gmt":"2004-11-11T19:48:11","guid":{"rendered":"http:\/\/blografia.net\/vicm3\/?p=33"},"modified":"2004-11-11T19:48:11","modified_gmt":"2004-11-11T19:48:11","slug":"svn","status":"publish","type":"post","link":"https:\/\/blografia.net\/vicm3\/2004\/11\/svn\/","title":{"rendered":"svn"},"content":{"rendered":"<p>Bien en algun momento tuve que implementar subversion, es probable que en la version que alguien este instalando en este momento ya no haya ningun problema (de hecho en la ultima que tengo noticia, se puede elegir entre usar Berkeley DB y otro metodo para evitar problemas, pero si alguien esta teniendo o tiene problemas con los permisos en subversion y\/o con multiples usuarios accesando al repositorio no estaria de mas que leyera el siguiente texto (sacado de un log de oficina):<\/p>\n<p>11\/09\/2004 20:46 &#8211;TESTED<br \/>\nIT &#8211;VM<br \/>\nse cierra<br \/>\n11\/09\/2004 20:46 &#8211;CLOSED<br \/>\nIT &#8211;n\/a<br \/>\n09\/22\/2004 12:48 &#8211;PENDING<br \/>\nIT &#8211;VM &#8211;2.00 hrs<br \/>\nHasta nueva version de subversion la solucion es la que ya se encontro.<br \/>\nEs decir, si se van a tener usuarios locales, mantener el numero bajo y como hack feo estar cambiando los permisos mediante cron (risky), no tener usuarios locales en la maquina donde esta el repositorio, o que estos solo accesen via svn+ssh (claro primero colocando el wrapper para svnserve) esta ultima es la solucion mas recomendada (hasta  que haya modificacion en el svn)<br \/>\n07\/29\/2004 16:18 &#8211;SOLUTION<br \/>\nIT &#8211;VM &#8211;2.00 hrs<br \/>\nLa solucion de Alioth (ACLS), es solo usar un metodo para la escritura&#8230; citando:<br \/>\nWrite access is only allowed through svnserve over a ssh transport. Access control is handled through Alioth.<br \/>\nDecidir si dejamos esto aun para los usuarios locales&#8230;<br \/>\n07\/29\/2004 03:19 &#8211;LABOR<br \/>\nIT &#8211;VM &#8211;1.00 hrs<br \/>\nEl hack parece funcionar&#8230; mas aun por que le toma casi el minuto completo hacer un commit u otra operacion a linux, con lo cual tambien se ejuta el cron \u00abjust in time\u00bb&#8230; queda pendiente el arreglar como se debe esta cosa.<br \/>\n07\/29\/2004 03:04 &#8211;ACTION<br \/>\nIT &#8211;VM &#8211;1.00 hrs<br \/>\nCron para mantener los permisos corrido cada minuto.<br \/>\nComo fue detallado en el caso del servidor de debian, en el caso de muchos desarrolladores si es \u00abriesgoso\u00bb, aqui vamos a implementarlo mientras no tengamos mejor solucion.<br \/>\nMandar correo al admin de debian, para ver como resolvieron el problema.<br \/>\nsolucion propuesta:<br \/>\n#!\/bin\/bash<br \/>\nchmod ug+w \/var\/svn\/mundito\/db\/*<br \/>\nchown svn.svn \/var\/svn\/mundito\/db\/*<br \/>\n07\/29\/2004 02:59 &#8211;NOTE<br \/>\nIT &#8211;VM &#8211;2.00 hrs<br \/>\n-rw-rw-r&#8211; 1 svn svn 1023k Jul 29 02:49 log.0000000013<br \/>\n-rw-r&#8211;r&#8211; 1 vicm3 svn 232k Jul 29 02:50 log.0000000014<br \/>\nal llenarse el log crea uno nuevo con el usuario que estaba haciendo la ultima transaccion&#8230;<br \/>\nAhora lo interesante, se puede cambiar el tama\u00f1o del log&#8230; podria dejarlo crecer no se hasta varios megas para hacer que el problema se espacie un tanto mas&#8230;<br \/>\ndavid@linux:~\/borrame$ svn co file:\/\/\/var\/svn\/mundito\/<br \/>\nsvn: Berkeley DB error while committing Berkeley DB transaction for filesystem \/var\/svn\/mundito\/db:<br \/>\nDB_RUNRECOVERY: Fatal error, run database recovery<br \/>\n\/usr\/local\/bin\/svn: line 4: 22685 Aborted \/usr\/bin\/svn \u00ab$@\u00bb<br \/>\ndavid@linux:~\/borrame$ svn co file:\/\/\/var\/svn\/mundito\/<br \/>\nsvn: Unable to open an ra_local session to URL<br \/>\nsvn: Unable to open repository &#8216;file:\/\/\/var\/svn\/mundito&#8217;<br \/>\nsvn: Berkeley DB error while opening environment for filesystem \/var\/svn\/mundito\/db:<br \/>\nDB_RUNRECOVERY: Fatal error, run database recovery<\/p>\n<p>aqui el error documentado.<br \/>\nLa otra solucion parcial seria la alliot&#8230; usar un cron (hasta que entienda lo de las ACLS).<br \/>\nMhh..<br \/>\n07\/29\/2004 02:18 &#8211;NOTE<br \/>\nIT &#8211;VM &#8211;0.10 hrs<br \/>\nBerkeley DB creates logfiles as needed, each of which grows to a set maximum size before another is created. In my oft-executed repository creation script, I was very careful to set the permissions so both myself (as a local client) and remote Web users were able to access the repository. But when the first logfile filled, as I locally modified the repository, a new logfile would be created, owned by myself with permissions limited by my umask. When Apache&#8217;s mod_dav_svn, running as the www user, later attempted to access the repository and couldn&#8217;t read the new log file. BDB interpreted this error as indicating database corruption. Subsequent access to the database in any form failed.<br \/>\nhttp:\/\/radio.weblogs.com\/0100148\/2002\/10\/20.html<br \/>\n07\/29\/2004 02:03 &#8211;ACTION<br \/>\nIT &#8211;VM &#8211;4.00 hrs<br \/>\nhttp:\/\/alioth.debian.org\/tracker\/index.php?func=detail&#038;aid=300579&#038;group_id=1&#038;atid=200001<br \/>\nel error que encontramos no es tan trivial como pareciera&#8230; de lo que leo hay dos soluciones, rapidas&#8230;<br \/>\n1) Crear un solo usuario con el que todos hagan uso de svn<br \/>\n2) Usar ACL (aun no entiendo como)<br \/>\nComo nota al calce este mismo problema tambien lo tuvo gnome&#8230;<br \/>\nTracker: Support Requests<\/p>\n<p>Submit New | Browse | Admin<\/p>\n<p>[ #300579 ] permissions system is a disaster waiting to happen<br \/>\nDate:<br \/>\n2004-03-21 13:51 Priority:<br \/>\n8<br \/>\nSubmitted By:<br \/>\nJoey Hess (joeyh) Assigned To:<br \/>\nLocal GForge Admin (admin)<br \/>\nCategory:<br \/>\nSubVersioN State:<br \/>\nClosed<br \/>\nSummary:<br \/>\npermissions system is a disaster waiting to happen<\/p>\n<p>Detailed description:<br \/>\nAlioth&#8217;s subversion permissions system is broken in subtle ways that affect more active projects. First an overview of the system as I understand it:<\/p>\n<p>Subversion is set up to work properly iff all files in the db\/ directory are owned by user www-data, and the group of the project, and mode 664. The www-data ownership is used because alioth includes http access, and user www-data cannot be a member of every project on alioth. The anonymous svnserve processes also run as www-data. The project&#8217;s group must also be able to write to every file though, thus the 664.<\/p>\n<p>There is a little problem. Berkeley db likes to make new log files, and while the fact that the db directory is g+s means they are owned by the right group, they will be owned by whatever user is running the subversion process that makes the new log file, and, with a typical umask, will be mode 644. This means that www-data will not be able to write to them.<\/p>\n<p>Now, there is a nasty little cron job that runs every minute on alioth, going through and chowning and chmodding the db files, so a file can only have the bad owner and mode for a fraction of a minute. So in the typical case, with a lightly used repository, everything seems to work ok, most of the time.<\/p>\n<p>We discovered today how broken this system really is when we moved the very heavily used d-i repository to subversion on alioth, and let a hundred people or so all try to check it out and commit to it at once. We have experienced four instances of the db getting wedged today. In two of these cases, there have been svnserve processes that were stuck in tight select loops:<\/p>\n<p>select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)<br \/>\nselect(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)<br \/>\nselect(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)<\/p>\n<p>And had a lock on the database, preventing recovery. One of these, process 2277, may still be running. (We hacked around the locking problem.)<\/p>\n<p>I don&#8217;t understand the cause of the select loops, but based on when the db got wedged and how the log files looked around then and other things, I hypothesise that the db wedge problem is at least partially caused by the following scenario:<\/p>\n<p>1. user a accesses the repo, via svnserve<br \/>\n2. svn creates a new log file, mode 644, owned by user a.<br \/>\n3. user b accesses the repo, via http.<br \/>\n4. as it is unable to write to the new log file, the svn running as www-data<br \/>\nmarks the db as needing recovery<\/p>\n<p>Normally there would be a run of the minutely cron job in between steps 2 and 3, but with an active repository, there is no guarantee of this happening.<\/p>\n<p>Of course, this is hardly the only race. Looking at your cron job, I see another race. First it chowns all files to www-data, then it goes back through and fixes the permissions. There is a race here that can result in a file owned by www-data and mode 644 existing in the repo, when the user who just created that same file with a previous subversion invocation tries to access it, fails, and wedges the repository once again.<\/p>\n<p>I respectfully encourage the alioth admins to find a repository permissions setup that is not brain-damanged, or the d-i project may have to take our repository elsewhere.<\/p>\n<p>Two suggestions for fixing it would be to use ACLs, or to put wrappers around all the subversion stuff that sets a sane umask. Bastian Blank has experience with successfully using ACLs with subversion; I have used the latter method successfully on multi-user subversion repositories.<br \/>\n07\/27\/2004 20:54 &#8211;ACTION<br \/>\nIT &#8211;VM &#8211;4.00 hrs<br \/>\nRevision de version, actualizacion, reincorporacion de repositorios.<br \/>\nDirectorios u+s g+s db\/<br \/>\nde vez en vez.. tenemos fallas aun&#8230;<\/p>\n<p>07\/22\/2004 20:25 &#8211;ACTION<br \/>\nIT &#8211;VM &#8211;4.00 hrs<br \/>\nsvn. Vian rompe el repositori&#8230; version anterior del subversion????, sticky bit a grupo al grupo mundito.<br \/>\nsvnserve para acceso de usuarios anonimos<br \/>\nsvn checkout svn:\/\/linux.ajusco.upn.mx\/mundito<br \/>\n07\/22\/2004 20:24 &#8211;ACTION<br \/>\nIT &#8211;VM &#8211;3.00 hrs<br \/>\nCreacion de wrappers para subversion&#8230;<br \/>\nprueba de tortoise, svn+ssh, svn file y otras&#8230; solo se rompe al usarlo Vian<br \/>\n07\/19\/2004 15:23 &#8211;LABOR<br \/>\nIT &#8211;VM &#8211;2.50 hrs<br \/>\nCreacion del grupo svn para uso de subversion<br \/>\ncreacion de nuevo del repositorio<br \/>\naplicacion de permisos adecuados<br \/>\nrecreacion de los repositorios del servidor<br \/>\npuesta a punto.<br \/>\n(revisar si la conexion por tortoise cvs sigue rompiendo los permisos, svnserve?)<br \/>\n07\/19\/2004 15:22 &#8211;LABOR<br \/>\nIT &#8211;VM &#8211;2.00 hrs<br \/>\nActualizacion de version de subversion<br \/>\nbackup del repositorio original<br \/>\n07\/09\/2004 14:25 &#8211;NOTE<br \/>\nIT &#8211;VM &#8211;1.00 hrs<br \/>\n\u00bfQue version de svn tenemos?<br \/>\n\u00bfQue base de datos usa?<br \/>\n\u00bfPodemos migrar a la version mas nueva, sin romper el repositorio?<br \/>\n07\/09\/2004 14:24 &#8211;ACTION<br \/>\nIT &#8211;VM &#8211;2.00 hrs<br \/>\nFallo en subversion, otra vez la base de datos&#8230; script para mantener los permisos de la BD svn.perm.sh<br \/>\n05\/31\/2004 13:42 &#8211;NOTE<br \/>\nIT &#8211;VM &#8211;2.00 hrs<br \/>\nBueno cambio de grupo chmod g+s db\/ -R<br \/>\na todo lo que esta en las Bases de Datos&#8230;<br \/>\nsvnadmin recovery \/var\/svn\/mundito<br \/>\nveamos si ahora si jala la cosa esta .. finalmente<br \/>\n05\/27\/2004 23:13 &#8211;QUESTION<br \/>\nIT &#8211;VM &#8211;1.00 hrs<br \/>\nVuelve a fallar en la creacion en \/var\/svn\/mundito\/db<br \/>\ncuando crea los logs, les asigna el gid y uid de quien los creo en lugar de los del grupo&#8230;<br \/>\ninvestigar como resolver esto.<br \/>\n05\/24\/2004 19:41 &#8211;SOLUTION<br \/>\nIT &#8211;VM &#8211;1.00 hrs<br \/>\nThe svn+ssh:\/\/ server checklist<\/p>\n<p>It can be quite tricky to get a bunch of users with existing SSH accounts to share a repository without permissions problems. If you&#8217;re confused about all the things that you (as an admininstrator) need to do on a Unix-like system, here&#8217;s a quick checklist that resummarizes some of things discussed in this section:<br \/>\n-All of your SSH users need to be able to read and write to the repository. Put all the SSH users into a single group. Make the repository wholly owned by that group, and set the group permissions to read\/write.<\/p>\n<p>-Your users need to use a sane umask when accessing the repository. Make sure that svnserve (\/usr\/local\/bin\/svnserve, or wherever it lives in $PATH) is actually a wrapper script which sets umask 002 and executes the real svnserve binary.<\/p>\n<p>-When BerkeleyDB creates new logfiles, they need to be owned by the group as well, so make sure you run chmod g+s on the repository&#8217;s db directory.<br \/>\nhttp:\/\/svnbook.red-bean.com\/svnbook\/ch06s05.html<br \/>\n05\/24\/2004 19:38 &#8211;NOTE<br \/>\nIT &#8211;VM &#8211;1.00 hrs<br \/>\nThe most common problem administrators run into is repository ownership and permissions. Does every process (or user) in the previous list have the rights to read and write the Berkeley DB files? Assuming you have a Unix-like operating system, a straightforward approach might be to place every potential repository user into a new svn group, and make the repository wholly owned by that group. But even that&#8217;s not enough, because a process may write to the database files using an unfriendly umask<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bien en algun momento tuve que implementar subversion, es probable que en la version que alguien este instalando en este momento ya no haya ningun problema (de hecho en la ultima que tengo noticia, se puede elegir entre usar Berkeley &hellip; <a href=\"https:\/\/blografia.net\/vicm3\/2004\/11\/svn\/\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2143,"url":"https:\/\/blografia.net\/vicm3\/2020\/01\/git-y-moodle\/","url_meta":{"origin":33,"position":0},"title":"Git y Moodle","author":"vicm3","date":"7 enero, 2020","format":false,"excerpt":"Ah\u00ed por septiembre que anduve en un seminario en el IIEc y tuve la fortuna de compartir varias comidas con Gunnar, abri\u00f3 una de las gratas platicas de sobremesa con -\u00bfcual es tu flujo de trabajo habitual con git? A lo que conteste en ese entonces, \"no tengo, sigo usando\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":945,"url":"https:\/\/blografia.net\/vicm3\/2012\/08\/de-svn-y-su-nuevo-formato-sqlite\/","url_meta":{"origin":33,"position":1},"title":"De svn y su nuevo formato sqlite","author":"vicm3","date":"19 agosto, 2012","format":false,"excerpt":"O como le hab\u00eda puesto primero, para recordar... que ahora ser\u00eda para olvidar y ojala no me tope de nuevo con este error. Bueno en la versi\u00f3n 1.7.x de Subversion, tuve un error realmente est\u00fapido, bueno yo me la busque, pero pens\u00e9 que ser\u00eda realmente f\u00e1cil corregirlo, en Linux, en\u2026","rel":"","context":"En \u00abGeneral\u00bb","block_context":{"text":"General","link":"https:\/\/blografia.net\/vicm3\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":136,"url":"https:\/\/blografia.net\/vicm3\/2005\/09\/arqueologia_infiernetica\/","url_meta":{"origin":33,"position":2},"title":"Arqueologia&#8230; infiernetica","author":"vicm3","date":"1 septiembre, 2005","format":false,"excerpt":"From malopezm@vmredipn.ipn.mx Tue Feb 25 12:47:46 CST 1997 Received: from VMREDIPN.IPN.MX by tochtli.uam.mx with SMTP (1.39.111.2\/16.2) id AA272736464; Tue, 25 Feb 1997 12:47:44 -0600 Date: Tue, 25 Feb 1997 12:47:44 -0600 Return-Path: <malopezm@vmredipn.ipn.mx> Received: from aca by VMREDIPN.IPN.MX (IBM VM SMTP V2R2) with TCP; Tue, 25 Feb 97 12:43:29 EST\u2026","rel":"","context":"En \u00abSin categor\u00eda\u00bb","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/blografia.net\/vicm3\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1050,"url":"https:\/\/blografia.net\/vicm3\/2013\/05\/debian-7-0-wheezy\/","url_meta":{"origin":33,"position":3},"title":"Debian 7.0 Wheezy","author":"vicm3","date":"5 mayo, 2013","format":false,"excerpt":"Y bueno ayer, como hab\u00eda sido anunciado [1] se liber\u00f3 Wheezy (Debian 7.0) [2] despu\u00e9s de un buen rato, indispensable si piensas actualizar leer las notas de la versi\u00f3n (rel\u00e9ase notes) [3] o la gu\u00eda de instalaci\u00f3n si lo piensas instalar desde cero [4], en todo caso en mi desktop\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2600,"url":"https:\/\/blografia.net\/vicm3\/2024\/11\/eureka\/","url_meta":{"origin":33,"position":4},"title":"Eureka","author":"vicm3","date":"9 noviembre, 2024","format":false,"excerpt":"Cual dice arriba, lo encontr\u00e9, pero me estoy adelantando, como escrib\u00ed anteriormente, dej\u00f3 de funcionar el agregador de blografia y aunque lo pens\u00e9 como proyecto de fin de semana, m\u00e1s bien le fui dedicando por ah\u00ed una tarde de s\u00e1bado, varias noches y una ma\u00f1ana de jueves\u2026 Teniendo el antecedente\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2738,"url":"https:\/\/blografia.net\/vicm3\/2025\/12\/moodle-4-5-lts\/","url_meta":{"origin":33,"position":5},"title":"Moodle 4.5 LTS","author":"vicm3","date":"5 diciembre, 2025","format":false,"excerpt":"Este a\u00f1o me propuse en verano hacer el cambio de versi\u00f3n Moodle para pasarme a la versi\u00f3n de soporte a largo plazo (Long Term Support LTS) y medio lo prepar\u00e9, fui al DC25, estuve haciendo otras cosas, sali\u00f3 Debian 13 (Trixie) y lo que pens\u00e9 que era un mont\u00f3n de\u2026","rel":"","context":"En \u00abDebian\u00bb","block_context":{"text":"Debian","link":"https:\/\/blografia.net\/vicm3\/category\/debian\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":0,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}