Hi Xu,

This shouldn't be a common problem. Generally a site directory maps to a
database, and once created it's rare to move it. In your case, you hit some
sort of bug with our logging failing due to the moved site directory,
causing the other logic that would normally detect the move to fail. We'll
have to look into that, but going forward, I don't imagine you'll need to
move it again?

Christian

On Thu, Sep 6, 2018 at 7:42 AM Yuanyuan Xu <yuanyuanxu.b...@gmail.com>
wrote:

> Hi Christian,
>
> Yes, I was reusing the same database when setting up a different site.
> After replacing the old url with the new one in siteconfig table, it all
> works. Thank you very much. But I am really keen to know that what is the
> proper way of getting rid of the unwanted site please? Is there a command
> in rb-site that we could use for this purpose? Thank you very much.
>
> Cheers,
> Xu
>
> On Tuesday, 4 September 2018 23:04:41 UTC+1, Christian Hammond wrote:
>>
>> Hi,
>>
>> These paths are stored in the database, so if you're reusing the same
>> database between different site locations, that's probably it. The paths
>> are all in the siteconfig_siteconfiguration table, so you can look in there
>> and see if you're seeing the old paths. You can then replace them with the
>> new ones, see if that gets you unstuck.
>>
>> Christian
>>
>> On Tue, Sep 4, 2018 at 6:50 AM Yuanyuan Xu <yuanyua...@gmail.com> wrote:
>>
>>> Hi Christian,
>>>
>>> Thanks for the head up. I will reset the key and password as you said.
>>>
>>> I didn't see any error pages when trying to sue DEBUG=True.
>>>
>>> By running the rb-site manage command with the path of sitedir( let's
>>> call it 'new sitedir'), I got an error message complaining about
>>> 'permission denied' of another sitedir(let's call it 'old sitedir') which I
>>> set up before but had it manually removed by removing the whole
>>> /var/wwww/old_sitedir and the conf file under /apaches/site-enabled. From
>>> the error message we can tell that rb-site manage was trying to install
>>> RBIntegrationsExtension to that old site.
>>>
>>> I couldn't find any clue why the manage command tried to access another
>>> site which was not mentioned in the command parameters at all. So I pip
>>> uninstalled ReviewBoard and installed again. Strangely, the old sitedir was
>>> back with only the htdocs/static/ext dir under it. And with
>>> RBIntegrationsExtension inside of it as well. Then I checked my 'new
>>> sitedir', nothing was there under static/ext. I copied the whole
>>> RBIntegrationsExtension dir from the 'old sitedir' over to the 'new
>>> sitedir' just in case.
>>>
>>> After that, I changed back to DEBUG=False, restarted apaches, and access
>>> the site again. Now I got 'Bad request(400)' error. After doing some
>>> googling, I changed the [Host-allowed] in settings.py to '*'. Restarted
>>> Apache, with DEBUG=True. I firstly got an error message asking me to chmod
>>> -R www-data to the static/ext of the old sitedir. After doing that, I can
>>> finally access the front page of Review Board. But to be honest, I am quite
>>> confused which static/ext dir is under use. I reckon it is the old one!
>>> Please note, the old sitedir has only have the static/ext dir under it.
>>>
>>> And I believe the previous error message ' No handlers could be found
>>> for logger "djblets.extensions.manager"' was triggered because of the
>>> missing of the old sitedir. That means to have my new site running, I have
>>> to keep the static/ext dir of the old site. Because it must be quoted
>>> somewhere. Could you please advice how to fix it? ps. The sequence of
>>> installation of the two sites is: 'install new site' -> 'install old site'
>>> -> 'manually remove the old site'. I hope it is not confusing you...
>>>
>>> I understand the manual removal of site dir may be the root cause of the
>>> mess up. But I was unable to find out how to delete a site in Review board.
>>> In the future, I may have to delete the current site and set up another one
>>> again. Could you please let me konw how to do a proper removal of a review
>>> site in Review Board? Your help is very much appreciates.
>>>
>>> Cheers,
>>> Xu
>>>
>>> Here is the error message of rb-site manage:
>>>
>>> rb-site manage /var/www/reviews.abcd.com/ set-siteconfig --
>>> --key=logging_enabled --value=true
>>> CRITICAL:djblets.extensions.manager:Unable to install extension media
>>> for Review Board Integrations to
>>> /var/www/reviews.rnd.abcd/htdocs/static/ext/rbintegrations.extension.RBIntegrationsExtension:
>>> [Errno 13] Permission denied: '/var/www/reviews.rnd.abcd'. The extension
>>> may not work, and pages may crash.
>>> Traceback (most recent call last):
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/djblets/extensions/manager.py",
>>> line 1155, in _install_extension_media_internal
>>>     shutil.copytree(extracted_path, ext_static_path, symlinks=True)
>>>   File "/usr/lib/python2.7/shutil.py", line 191, in copytree
>>>     os.makedirs(dst)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 157, in makedirs
>>>     mkdir(name, mode)
>>> OSError: [Errno 13] Permission denied: '/var/www/reviews.rnd.abcd'
>>> Traceback (most recent call last):
>>>   File "/usr/local/bin/rb-site", line 11, in <module>
>>>     sys.exit(main())
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/reviewboard/cmdline/rbsite.py",
>>> line 1972, in main
>>>     command.run()
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/reviewboard/cmdline/rbsite.py",
>>> line 1881, in run
>>>     initialize()
>>>   File "/usr/local/lib/python2.7/dist-packages/reviewboard/__init__.py",
>>> line 146, in initialize
>>>     get_extension_manager().load()
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/djblets/extensions/manager.py",
>>> line 655, in load
>>>     self._load_extensions(full_reload)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/djblets/extensions/manager.py",
>>> line 781, in _load_extensions
>>>     self._init_extension(ext_class)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/djblets/extensions/manager.py",
>>> line 891, in _init_extension
>>>     self.install_extension_media(ext_class)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/djblets/extensions/manager.py",
>>> line 1092, in install_extension_media
>>>     os.makedirs(media_version_dir, 0755)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 150, in makedirs
>>>     makedirs(head, mode)
>>>   File "/usr/lib/python2.7/os.py", line 157, in makedirs
>>>     mkdir(name, mode)
>>> OSError: [Errno 13] Permission denied: '/var/www/reviews.rnd.abcd'
>>>
>>> On Tuesday, 4 September 2018 02:33:22 UTC+1, Christian Hammond wrote:
>>>>
>>>> Do you see error pages when trying to use DEBUG=True?
>>>>
>>>> Let's try a workaround. We're going to ensure that logging is turned
>>>> on. Try running:
>>>>
>>>>     rb-site manage /path/to/sitedir set-siteconfig --
>>>> --key=logging_enabled --value=true
>>>>
>>>> Then restart Apache. See if you get any further. Make sure to leave in
>>>> that "--" after "set-siteconfig".
>>>>
>>>> Note: You provided your SECRET_KEY value from settings_local.py in the
>>>> e-mail, which isn't safe to expose to anyone. You will need to regenerate a
>>>> new one, and should change the password of any users you've created.
>>>>
>>>> Christian
>>>>
>>>> On Thu, Aug 30, 2018 at 3:11 AM Yuanyuan Xu <yuanyua...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Christian,
>>>>>
>>>>> Thank you very much for your reply.
>>>>>
>>>>> Here is the content of the Apache error log. The last four entries
>>>>> were created when I tried to access the web site on the local machine with
>>>>> 'localhost:8080/bot2' and hit HTTP 500 with DEBUG=False. I have configured
>>>>> the server to use port 8080 for this site and it works with DEBUG=True.
>>>>>
>>>>> [Thu Aug 30 00:05:27.731341 2018] [mpm_prefork:notice] [pid 21967]
>>>>> AH00163: Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/2.7 configured --
>>>>> resuming normal operations
>>>>> [Thu Aug 30 00:05:27.731962 2018] [core:notice] [pid 21967] AH00094:
>>>>> Command line: '/usr/sbin/apache2'
>>>>> [Thu Aug 30 10:06:56.403979 2018] [mpm_prefork:notice] [pid 991]
>>>>> AH00163: Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/2.7 configured --
>>>>> resuming normal operations
>>>>> [Thu Aug 30 10:06:56.404200 2018] [core:notice] [pid 991] AH00094:
>>>>> Command line: '/usr/sbin/apache2'
>>>>> [Thu Aug 30 10:30:59.183996 2018] [mpm_prefork:notice] [pid 991]
>>>>> AH00169: caught SIGTERM, shutting down
>>>>> [Thu Aug 30 10:30:59.273617 2018] [mpm_prefork:notice] [pid 3970]
>>>>> AH00163: Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/2.7 configured --
>>>>> resuming normal operations
>>>>> [Thu Aug 30 10:30:59.273663 2018] [core:notice] [pid 3970] AH00094:
>>>>> Command line: '/usr/sbin/apache2'
>>>>> [Thu Aug 30 09:31:19.244229 2018] [wsgi:error] [pid 3972] [client
>>>>> 127.0.0.1:36812] No handlers could be found for logger
>>>>> "djblets.extensions.manager"
>>>>>
>>>>>
>>>>> And here is the content of the settings_local.py:
>>>>>
>>>>>
>>>>> # Site-specific configuration settings for Review Board
>>>>> # Definitions of these settings can be found at
>>>>> # http://docs.djangoproject.com/en/dev/ref/settings/
>>>>>
>>>>> # Database configuration
>>>>> DATABASES = {
>>>>>     'default': {
>>>>>         'ENGINE': 'django.db.backends.mysql',
>>>>>         'NAME': 'reviewboard',
>>>>>         'USER': 'bot2',
>>>>>         'PASSWORD': 'bot2',
>>>>>         'HOST': 'localhost',
>>>>>         'PORT': '',
>>>>>     },
>>>>> }
>>>>>
>>>>> # Unique secret key. Don't share this with anybody.
>>>>> SECRET_KEY = '-1q@jfk_ow$uti6m36pyf)(gx1$%&zoh6qovfq*##(+*3fm72x'
>>>>>
>>>>> # Cache backend settings.
>>>>> CACHES = {
>>>>>     'default': {
>>>>>         'BACKEND':
>>>>> 'django.core.cache.backends.memcached.MemcachedCache',
>>>>>         'LOCATION': 'localhost:11211',
>>>>>     },
>>>>> }
>>>>>
>>>>> # Extra site information.
>>>>> SITE_ID = 1
>>>>> SITE_ROOT = '/bot2/'
>>>>> FORCE_SCRIPT_NAME = ''
>>>>> DEBUG = False
>>>>> ALLOWED_HOSTS = ['reviews.abcd.com']
>>>>>
>>>>>
>>>>> I couldn't find any other logs/information that may give any clue to
>>>>> this problem. Your help is very much appreciated.
>>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Xu
>>>>>
>>>>> On Wednesday, 29 August 2018 23:19:15 UTC+1, Christian Hammond wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> You should never need to set DEBUG=True in a production environment.
>>>>>> Can you find any other error information in Apache's error_log when you 
>>>>>> hit
>>>>>> the HTTP 500? And the full details of the one error log entry you 
>>>>>> mentioned?
>>>>>>
>>>>>> Christian
>>>>>>
>>>>>> On Wed, Aug 29, 2018 at 8:19 AM Yuanyuan Xu <yuanyua...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> The system I am working with:
>>>>>>>
>>>>>>> Ubuntu 18.04.1 LTS
>>>>>>> Python 2.7.15rcl
>>>>>>> Review board 3.0.8
>>>>>>>
>>>>>>> On Tuesday, 28 August 2018 17:32:43 UTC+1, Yuanyuan Xu wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I had a new Review Board site set up from scratch following the
>>>>>>>> document in Ubuntu. However, I got Error 500 when I tried to access my
>>>>>>>> site. But if I set DEBUG=True in the setting py file, I was able to 
>>>>>>>> access
>>>>>>>> the admin UI successfully. I have set the whole $site_folder Owner to
>>>>>>>> 'www-data'. And tried upgrading the whole system for several times. 
>>>>>>>> Still
>>>>>>>> got this error. In the error log, there are lots of "no handlers could 
>>>>>>>> be
>>>>>>>> found for logger djblets.extensions.manager" messages. The 'site 
>>>>>>>> allowed'
>>>>>>>> entry in the settings py file is correct, although I always use the IP
>>>>>>>> address directly instead. Could somebody help please? Thanks very much.
>>>>>>>>
>>>>>>>> Something broke! (Error 500)It appears something broke when you
>>>>>>>> tried to go to here. This is either a bug in Review Board or a server
>>>>>>>> configuration error. Please report this to your administrator.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Xu
>>>>>>>>
>>>>>>> --
>>>>>>> Supercharge your Review Board with Power Pack:
>>>>>>> https://www.reviewboard.org/powerpack/
>>>>>>> Want us to host Review Board for you? Check out RBCommons:
>>>>>>> https://rbcommons.com/
>>>>>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Review Board Community" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to reviewboard...@googlegroups.com.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Christian Hammond
>>>>>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>>>>>> Makers of Review Board <https://www.reviewboard.org/>
>>>>>>
>>>>> --
>>>>> Supercharge your Review Board with Power Pack:
>>>>> https://www.reviewboard.org/powerpack/
>>>>> Want us to host Review Board for you? Check out RBCommons:
>>>>> https://rbcommons.com/
>>>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Review Board Community" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to reviewboard...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>> --
>>>> Christian Hammond
>>>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>>>> Makers of Review Board <https://www.reviewboard.org/>
>>>>
>>> --
>>> Supercharge your Review Board with Power Pack:
>>> https://www.reviewboard.org/powerpack/
>>> Want us to host Review Board for you? Check out RBCommons:
>>> https://rbcommons.com/
>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Review Board Community" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to reviewboard...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Christian Hammond
>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>> Makers of Review Board <https://www.reviewboard.org/>
>>
> --
> Supercharge your Review Board with Power Pack:
> https://www.reviewboard.org/powerpack/
> Want us to host Review Board for you? Check out RBCommons:
> https://rbcommons.com/
> Happy user? Let us know! https://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "Review Board Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Christian Hammond
President/CEO of Beanbag <https://www.beanbaginc.com/>
Makers of Review Board <https://www.reviewboard.org/>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to